Discuss Scratch

HashtagBenches
Scratcher
4 posts

Help with Spindash

So I'm trying to make Sonic's spindash. The way I want it to work is: the longer you hold the button (down arrow) the further he'll go. I need help with making him do that. From what I understand, it should be: detecting whether the key is held down, while it's held down add numbers to a variable(s) (Spindash) until the key is let go, then release him, moving however many steps, and then clearing the variable(s).
chantszfung99
Scratcher
28 posts

Help with Spindash

You can do it like this:
whenclickedforeverifkeyright arrowpressed?thenchangex movingby0.2ifkeyleft arrowpressed?thenchangex movingby-0.2

whenclickedforeversetx movingto((x moving) * (0.9)) changexbyxmoving
chantszfung99
Scratcher
28 posts

Help with Spindash

chantszfung99 wrote:

whenclickedforeversetx movingto((x moving) * (0.9)) changexbyxmoving
Something went wrong above.
whenclickedforeversetx movingtoxmoving*0.9changexbyxmoving
By the way, there is no limit on its speed. If you want to set maximum speed, you should set a limitation.
whenclickedforeverifxmoving>5thensetx movingto5
FrankieJrJr
Scratcher
100+ posts

Help with Spindash

whenclickedforeverifkeyspacepressed?thenpointindirectionpickrandom-180to180
HashtagBenches
Scratcher
4 posts

Help with Spindash

Thanks! Not entirely what I was looking for, but I think I could tweak it a little to work how I intended.
2rayansonic3
Scratcher
3 posts

Help with Spindash

whenclickedforeverifkey xpressed?andkeydown arrowpressed?thenwaituntilnotkeyxpressed?andkey down arrowpressed?move4steps

might not sure try this not varibles

Last edited by 2rayansonic3 (March 4, 2021 14:28:00)

virockstr
Scratcher
8 posts

Help with Spindash

or maybe

2rayansonic3 wrote:

whenclickedforeverifkey xpressed?andkeydown arrowpressed?thenwaituntilnotkeyxpressed?andkey down arrowpressed?movespeedspindashsteps
mightnotsuretrythis
virockstr
Scratcher
8 posts

Help with Spindash

virockstr wrote:

or maybe

2rayansonic3 wrote:

whenclickedforeverifkey xpressed?andkeydown arrowpressed?thenrepeatuntilnotkey xpressed?andkeydown arrowpressed?>change speed spin dashby1>switchcostumeto spinbroadcast spin
mightnotsuretrythis


and

whenIreceive spinchangexbyspeedspindash

Last edited by virockstr (July 14, 2021 15:36:51)

wifighostGD
Scratcher
3 posts

Help with Spindash

None of these work for me. can you guys try and make some different scripts.
bean6445
Scratcher
49 posts

Help with Spindash

I already scrapped the idea of giving Japan the ability to do that move.
wifighostGD
Scratcher
3 posts

Help with Spindash

im not saying they don't work its just that i have arrow key movements and the spindash isn't staying still so it still works its just that the spindash moves when i press arrow keys. let me give you a link to my game https://scratch.mit.edu/projects/962105532/

Last edited by wifighostGD (Feb. 16, 2024 15:17:55)

ActingMan
Scratcher
1 post

Help with Spindash

Yeah one of the scrips work just my variable is at 370 which makes it go really fast
TysontheWolf
Scratcher
2 posts

Help with Spindash

TELL ME HOW YOU DID IT PLEASE
sonic_x10
Scratcher
1 post

Help with Spindash

chantszfung99 wrote:

You can do it like this:
whenclickedforeverifkeyright arrowpressed?thenchangex movingby0.2ifkeyleft arrowpressed?thenchangex movingby-0.2

whenclickedforeversetx movingto((x moving) * (0.9)) changexbyxmoving

Last edited by sonic_x10 (May 1, 2025 20:37:53)

Powered by DjangoBB