Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I gotta (TRY TO STOP THE) sprint!
- S_Manic
- Scratcher
5 posts
I gotta (TRY TO STOP THE) sprint!
So im workin on a game rn, and i have issues making a sprint (holding button kind) i need help with a code that stops when i stop holding said key
when green flag clicked
forever
say [WHAT DO I DOO!?]
end
- CHEEZ_ITZ_12oz
- Scratcher
64 posts
I gotta (TRY TO STOP THE) sprint!
use a wait until block.
wait until <not <key [ v] pressed?>>
-Cheese Guy
- TheCabb
- Scratcher
6 posts
I gotta (TRY TO STOP THE) sprint!
Maybe try
when green flag clicked
set [ speed] to [10]
forever
if <key [ whatever] pressed?> then
set [ speed] to [20]
wait (0.1) secs
set [ speed] to [10]
end
end
when green flag clicked
forever
if <key [ whatever] pressed?> then
move (speed) steps
end
end
Last edited by TheCabb (March 29, 2024 04:06:34)
forever
play sound until done
end
- Discussion Forums
- » Help with Scripts
- » I gotta (TRY TO STOP THE) sprint!