Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » the "repeat until" block isn't working
- VintageCupcake
-
3 posts
the "repeat until" block isn't working
I want my sprite to move right until the space key is pressed and then move up until the space key is pressed but it keeps going right even if I press the space key.

Am i doing something wrong?

- GunChleoc
-
500+ posts
the "repeat until" block isn't working
It works if you define a different key in the second block. I'm new to Scratch, so don't ask my why you can't use the same key for both.
- drmcw
-
1000+ posts
the "repeat until" block isn't working
When that script is running then the sprite will move right until the space key is pressed, once it is pressed then the script drops through to the next bit of script and runs that. The time that script takes to run would depend on your PC but would likely be measurable in nanoseconds. Even assuming the key pressed logic reads the keys each time you request it then do you think you'd be able to lift the key within a nanonsecond timescale? IN other words for the next loop the key pressed will always be true so it will never go upwards. If you want to have the space key released after the first repeat then add
- 3sal2
-
100+ posts
the "repeat until" block isn't working
Because you have a copy of the first repeat until block beneath the first one.
- Seapats
-
70 posts
the "repeat until" block isn't working
beacause you have the same operator!
Try:
Try:
- Truebuild
-
3 posts
the "repeat until" block isn't working
This example shows a not operator with round ends inside a wait until control! beacause you have the same operator!
Try:
in my scratch (I presume scratch 2) the wait until control has diamond shaped ends and the key press sensing code is diamond sharp ended (not rounded)
Why is that?
I am looking at this code because I want to implement this example but in my case using “J” instead of space key
when space key pressed this is ok
set pressingspace to 1 this is ok because I have created a variable “pressingJ”
wait until pressingspace<0 this is the problem because pressingJ is a long oval and does not fit the square box < box 0 in wait until
wait until not key space pressed this is the problem because pressingJ is a long oval and does not fit the long diamond socket in wait until
set pressingspace to 0 this is ok
Help please
Last edited by Truebuild (Feb. 8, 2016 21:31:15)
- smiley_cat_rulez
-
100+ posts
the "repeat until" block isn't working
Last edited by smiley_cat_rulez (Feb. 9, 2016 02:40:42)
- Discussion Forums
- » Bugs and Glitches
-
» the "repeat until" block isn't working