Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » drift scripts
- 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:
Also be sure to set the direction of your sprite to all around, to see the car turning.
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
You mean this? 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
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
You mean this?
I guess that makes the script more clear, so I added the changes, thanks
- PredaDog
- Scratcher
41 posts
drift scripts
ok
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:
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… I made some changes to your script, in order to simplify the code. Let me know if this works alright: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 :Iforever
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]
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:
forevermust be alone because of “wait” block put inside original one… WELL I HATE DOING SCRIPTS IN FORUMS >
move (speed) steps
end
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/
(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)
- 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 projects■how I made the banner■animated thumbnails?■i’m on wiki!■Cubey Mines|
|other projects■how I made the banner■animated 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]
- Discussion Forums
- » Help with Scripts
- » drift scripts