Discuss Scratch

PredaDog
Scratcher
41 posts

drift scripts

could anyone tell me how to make typical drift into cars in scratch? i mean: i'm moving to the north and turned to the west but the car is still moving to the north slower and slower…. there's my script without drift:
forevermovespeedsteps
foreverifkeyW or up arrowpressed?thenifspeed<10thenchangespeedby1elseifkeys or down arrowpressed?thenchangespeedby-1elseifspeed<0.1andspeed>-0.1thensetspeedto0elseifspeed<0thenchangespeedby0.1elsechangespeedby-0.1ifkeyleftpressed?thenturnspeed*0degreesifkeyrightpressed?thenturnspeed*0degrees
Spidertest
Scratcher
47 posts

drift scripts

I made some changes to your script, in order to simplify the code. Let me know if this works alright:

foreverifkeywpressed?orkeyup arrowpressed?thenchangespeedby1ifkeyspressed?orkeydown arrowpressed?thenchangespeedby-1setspeedtospeed*0.9ifkeyleft arrowpressed?thenturnspeed*0.6degreesifkeyright arrowpressed?thenturnspeed*0.6degreesmovespeedsteps

Also be sure to set the direction of your sprite to all around, to see the car turning.

setrotationstyleall around

Last edited by Spidertest (March 21, 2018 13:50:12)

FuturePr0
Scratcher
100+ posts

drift scripts

Spidertest wrote:

I made some changes to your script, in order to simplify the code. Let me know if this works alright:

foreverifkeyW or up arrowpressed?thenchangespeedby1ifkeys or down arrowpressed?thenchangespeedby-1setspeedtospeed*0.9ifkeyleftpressed?thenturnspeed*0.6degreesifkeyrightpressed?thenturnspeed*0.6degreesmovespeedsteps
You mean this?
foreverifkeywpressed?orkeyup arrowpressed?thenchangespeedby1ifkeyspressed?orkeydown arrowpressed?thenchangespeedby-1setspeedtospeed*0.9ifkeyleft arrowpressed?thenturnspeed*0.6degreesifkeyright arrowpressed?thenturnspeed*0.6degreesmovespeedsteps
Spidertest
Scratcher
47 posts

drift scripts

FuturePr0 wrote:

You mean this?

I guess that makes the script more clear, so I added the changes, thanks
PredaDog
Scratcher
41 posts

drift scripts

ok

Spidertest wrote:

I made some changes to your script, in order to simplify the code. Let me know if this works alright:

foreverifkeywpressed?orkeyup arrowpressed?thenchangespeedby1ifkeyspressed?orkeydown arrowpressed?thenchangespeedby-1setspeedtospeed*0.9ifkeyleft arrowpressed?thenturnspeed*0.6degreesifkeyright arrowpressed?thenturnspeed*0.6degreesmovespeedsteps

Also be sure to set the direction of your sprite to all around, to see the car turning.

setrotationstyleall around
okay okay…. i knew that im in scratch since…. 2 years i made these scripts up that bad because i rarely use forum and thats so difficult to make same scripts in forum as in editor… BUT i didn't asked for improving these scripts (well i asked for that but not in that way) I asked for DRIFT SCRIPTS, okay? by the way dont pay attention to these uppercase letters :I





let's go to start:
im asking for help with drift scripts, that mean: i'm moving to the north and turned to the west but the car is still moving to the north slower and slower… added: and moving faster and faster to the west .and sorry if i offend you i didnt mean to do that im still learning english.
and thats script:
forevermovespeedsteps
must be alone because of “wait” block put inside original one… WELL I HATE DOING SCRIPTS IN FORUMS >

Last edited by PredaDog (March 21, 2018 16:19:51)

bry22333
Scratcher
16 posts

drift scripts

Oh Ok (RUDE)
(WUT WAIT BLOCK)
I made A Script Based On Yours
Im Still Working On It But You Can Improve It.
https://scratch.mit.edu/projects/211560730/

Last edited by bry22333 (March 21, 2018 17:09:38)

hej0120
New Scratcher
1 post

drift scripts

hallo
griefercube
Scratcher
500+ posts

drift scripts

Please don’t necropost

Last edited by griefercube (Aug. 23, 2021 06:27:22)

Powered by DjangoBB