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:
forever
move (speed) steps
end
forever
if <key [W or up arrow v] pressed?> then
if <(speed) < [10]> then
change [speed v] by (1)
end
else
if <key [s or down arrow v] pressed?> then
change [speed v] by (-1)
else
if <<(speed) < [0.1]> and <(speed) > [-0.1]>> then
set [speed v] to [0]
else
if <(speed) < [0]> then
change [speed v] by (0.1)
else
change [speed v] by (-0.1)
end
end
end
end
if <key [left v] pressed?> then
turn ccw ((speed) * (0)) degrees
end
if <key [right v] pressed?> then
turn cw ((speed) * (0)) degrees
end
end

zapraszam na mój konkurs znajduje się on tutaj (konkurs)


(i invite you to the contest-> here is it)


define fun
say [thats scratch]
play sound [meow v]
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:

forever
if <<key [w v] pressed?> or <key [up arrow v] pressed?>> then
change [speed v] by (1)
end
if <<key [s v] pressed?> or <key [down arrow v] pressed?>> then
change [speed v] by (-1)
end
set [speed v] to ((speed) * (0.9))
if <key [left arrow v] pressed?> then
turn ccw ((speed) * (0.6)) degrees
end
if <key [right arrow v] pressed?> then
turn cw ((speed) * (0.6)) degrees
end
move (speed) steps
end

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

set rotation style [all around v]

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:

forever
if <key [W or up arrow v] pressed?> then
change [speed v] by (1)
end
if <key [s or down arrow v] pressed?> then
change [speed v] by (-1)
end
set [speed v] to ((speed) * (0.9))
if <key [left v] pressed?> then
turn ccw ((speed) * (0.6)) degrees
end
if <key [right v] pressed?> then
turn cw ((speed) * (0.6)) degrees
end
move (speed) steps
end
You mean this?
forever
if <<key [w v] pressed?> or <key [up arrow v] pressed?>> then
change [speed v] by (1)
end
if <<key [s v] pressed?> or <key [down arrow v] pressed?>> then
change [speed v] by (-1)
end
set [speed v] to ((speed) * (0.9))
if <key [left arrow v] pressed?> then
turn ccw ((speed) * (0.6)) degrees
end
if <key [right arrow v] pressed?> then
turn cw ((speed) * (0.6)) degrees
end
move (speed) steps
end

BRUH
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:

forever
if <<key [w v] pressed?> or <key [up arrow v] pressed?>> then
change [speed v] by (1)
end
if <<key [s v] pressed?> or <key [down arrow v] pressed?>> then
change [speed v] by (-1)
end
set [speed v] to ((speed) * (0.9))
if <key [left arrow v] pressed?> then
turn ccw ((speed) * (0.6)) degrees
end
if <key [right arrow v] pressed?> then
turn cw ((speed) * (0.6)) degrees
end
move (speed) steps
end

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

set rotation style [all around v]
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:
forever
move (speed) steps
end
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)


zapraszam na mój konkurs znajduje się on tutaj (konkurs)


(i invite you to the contest-> here is it)


define fun
say [thats scratch]
play sound [meow v]
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 to Scratch
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)



sometimes, you just have to change a way of thinking to solve a problem. -griefercube
|other projectshow I made the banneranimated thumbnails?i’m on wiki!Cubey Mines|

Last edited by griefercube (32th Undecimber, XXXX)


https://turbowarp.org/563693837/editor (something i did a while back don’t worry it’s for the banner)

list of working bbcodes:

[color=]
[scratchblocks]
[url=]
[img]
[center]
[code]
[code=]
[list]
[quote]
[b]
[i]
[u]
[s]
[big]
[small]
[p]
[wiki]
[google]

Powered by DjangoBB