Discuss Scratch

Norse7
Scratcher
67 posts

Acceleration/Deacceleration system for platformer

So, I want to make a system so that when the player gives an input, the player will accelerate and have a capped speed limit, then deaccelerate. I want the acceleration/deacceleration to be linear. It's been a while since I coded a platformer, so help would be appreciated!

My project: https://scratch.mit.edu/projects/991899132

“It’s not a bug; it’s an undocumented feature.” ― Anonymous

when green flag clicked
forever
change [ awesomeness] by (1)
end
chippysmall4
Scratcher
1000+ posts

Acceleration/Deacceleration system for platformer

Here: Use This!, if you use it, please credit the project creator.

(Highlight + Shift + Down To See The Rest Of My Signature!)
Hi! I'm Cosmic-


Stuf
| Scratch Wiki | Empty My Stuff? Click Here! | Ocular | The SCM! | Project Nexus | More On The MyStuff Bug | Advanced Topics |



chaos



e
*digital art noises*
*forum noises*
Norse7
Scratcher
67 posts

Acceleration/Deacceleration system for platformer

maybe not that, I want to keep the code as small as possible and easy to change the values. I also don't want multiple green flags.

Last edited by Norse7 (March 29, 2024 13:11:18)


“It’s not a bug; it’s an undocumented feature.” ― Anonymous

when green flag clicked
forever
change [ awesomeness] by (1)
end
MineTurte
Scratcher
500+ posts

Acceleration/Deacceleration system for platformer

Norse7 wrote:

maybe not that, I want to keep the code as small as possible and easy to change the values. I also don't want multiple green flags.
Well tbh some things just require that. If you want I could give you a simplish 2D Top-down code for smooth movement and you can customize it for your platformer.

(pronouns are she/her). Advanced Alpha Game Studios Manager; website: https://aags2.w3spaces.com
This is JuniperActias. AKA Moth mommy. If I helped you out consider following Juni-Bug (my new account)!




If you found this secret, say uwu
Signature gradients here













jaskeI
Scratcher
100+ posts

Acceleration/Deacceleration system for platformer

I actually made something like this, here it is! https://scratch.mit.edu/projects/983779292/

Hello, I am Jaskel!

I am a Scratch coder with 5+ years experience, and enjoy helping people on the ¨Help with Scripts¨ Forum.
CrazyCoolYT
Scratcher
25 posts

Acceleration/Deacceleration system for platformer

My friend made a movement system you can check out here:
https://scratch.mit.edu/projects/697066428
Note that this is done by adding velocity (not moving the player outright) to the player in certain directions.

Hey! You, reading this! Wanna kill some zombies like a super-freakin'-cool action hero (insert cool emoji)? Well, you're in luck, because I've got just the game for you!

https://scratch.mit.edu/projects/689579905/

You're welcome!
Norse7
Scratcher
67 posts

Acceleration/Deacceleration system for platformer

Thanks to both of you! this will really help.

“It’s not a bug; it’s an undocumented feature.” ― Anonymous

when green flag clicked
forever
change [ awesomeness] by (1)
end

Powered by DjangoBB