Discuss Scratch

JonlikesFMJZ1
Scratcher
2 posts

car turns slower when speed up.

i need help to make the car turn slower when it speeds up. (this is a scrolling racing game) i have three variables: “speed”, “acceleration”, “turn speed”.

whenclickedsetscroll Xto0setscroll Yto0setspeedto0foreverifkeywpressed?thenchangeY velocitybycosofdirection*speedchangeX velocitybysinofdirection*speedifspeed<max speedthenchangespeedbyaccelerationifkeyspressed?thenchangeY velocitybycosofdirection*-1*speedchangeX velocitybysinofdirection*-1*speedifspeed<max speedthenchangespeedbyacceleration*-1ifkeydpressed?thenturnturnspeeddegreesifkeyapressed?thenturnturnspeeddegrees

(THE PART WHERE I NEED HELP)
whenclickedsetturn speedtoforever

Last edited by JonlikesFMJZ1 (July 9, 2024 22:55:46)

deck26
Scratcher
1000+ posts

car turns slower when speed up.

So what's wrong with what you have? As long as max speed is less than 4.5 it will reduce turn speed as speed increases but perhaps not in the way you want but we need to see the project and have more information in order to help.
Jlerpy
Scratcher
1000+ posts

car turns slower when speed up.

If turn speed is always 4.5-Speed, you shouldn't need a variable for it, as you can just put 4.5-Speed in there, can't you?

Powered by DjangoBB