Discuss Scratch

eaglelaser66
Scratcher
4 posts

How do I make the car drift in one of my projects.

I need help on how to make the car drift in my project: http://scratch.mit.edu/projects/33997178/
Awesomeguy360
Scratcher
44 posts

How do I make the car drift in one of my projects.

well you need to make a variable (x) and change it by 0.1 when you press RIGHT. change it by -0.1 when you go LEFT. Then make a variable (y) and change it by 0.1 when you press UP. change it by -0.1 when you go DOWN. then change X by (x) and change Y by (y)
FrankieJrJr
Scratcher
100+ posts

How do I make the car drift in one of my projects.

whenclickedforeverifkeyright arrowpressed?thensetvelXto2repeatuntilnotkeyright arrowpressed?changexbyvelXrepeatuntilvelX=0 changevelXby-0.1changexbyvelX

Then Switch every negative number and every positive number and switch the right arrow keys to left.
FrankieJrJr
Scratcher
100+ posts

How do I make the car drift in one of my projects.


Sorry, the second “repeat untill” should be right after the first “repeat untill”.
WO997
Scratcher
64 posts

How do I make the car drift in one of my projects.

https://scratch.mit.edu/projects/55110018/ here you have a very good car physics engine, the problem is that the scripts are so huge, anyway I can tell you what do they do
dude341
Scratcher
1000+ posts

How do I make the car drift in one of my projects.

foreverifkeyleftpressed?thensetytoypositionifnoty=ypositionthenrepeat100turn10degrees
LeonBerar
Scratcher
2 posts

How do I make the car drift in one of my projects.

whenclickedforeverifkeyleft pressed?thenset xVto-10ifkeyrightpressed?thenset xVto10changextoxVset xVtoxV*0.9

Last edited by LeonBerar (July 24, 2018 18:02:08)

shoresbeep
Scratcher
1000+ posts

How do I make the car drift in one of my projects.

LeonBerar wrote:

whenclickedforeverifkeyleft pressed?thenset xVto-10ifkeyrightpressed?thenset xVto10changextoxVset xVtoxV*0.9
Please don't necropost.
s_s_code
Scratcher
1 post

How do I make the car drift in one of my projects.

how do i make skid marks when you drift

Last edited by s_s_code (Dec. 7, 2019 02:03:20)

SonicFan2018
Scratcher
21 posts

How do I make the car drift in one of my projects.

s_s_code wrote:

how do i make skid marks when you drift

First of all, you will need a skid mark sprite, and there are two methods. One is to use pen and stamp, but the track must be a backdrop (pen won't write over sprites), or create clones of the skid marks. I only know how to do the first method, so here is a concept of it. Our car sprite will be named “vroom”, and our “direction” variable will be set to the car's direction.

whenclickedforeverpointindirectiondirectiongotovroomifkeyright arrowpressed?orkeyleft arrowpressed?thenstamp

Hope this helped. If i'm wrong, correct me.

Last edited by SonicFan2018 (Feb. 24, 2020 22:48:05)

NASAMEP-Test
Scratcher
4 posts

How do I make the car drift in one of my projects.

whenclickedsetX velocityto0setY velocityto0foreversetX velocitytoXvelocity+sinofdirection*keyup arrowpressed?+keydown arrowpressed?*-1*0.93setY velocityto(((Y velocity) + (([cosofdirection)*keyup arrowpressed?+keydown arrowpressed?*-1))*0.93)]turnkeyup arrowpressed?*keyright arrowpressed?*6+keyleft arrowpressed?*-6degreesturnkeydown arrowpressed?*keyright arrowpressed?*-6+keyleft arrowpressed?*6degreeschangexbyXvelocitychangeybyYvelocity
NASAMEP-Test
Scratcher
4 posts

How do I make the car drift in one of my projects.

NASAMEP-Test wrote:

whenclickedsetX velocityto0setY velocityto0foreversetX velocitytoXvelocity+sinofdirection*keyup arrowpressed?+keydown arrowpressed?*-1*0.93setY velocityto(((Y velocity) + (([cosofdirection)*keyup arrowpressed?+keydown arrowpressed?*-1))*0.93)]turnkeyup arrowpressed?*keyright arrowpressed?*6+keyleft arrowpressed?*-6degreesturnkeydown arrowpressed?*keyright arrowpressed?*-6+keyleft arrowpressed?*6degreeschangexbyXvelocitychangeybyYvelocity
I think I did something wrong with the
setY velocityto
NASAMEP-Test
Scratcher
4 posts

How do I make the car drift in one of my projects.

SonicFan2018 wrote:

s_s_code wrote:

how do i make skid marks when you drift

First of all, you will need a skid mark sprite, and there are two methods. One is to use pen and stamp, but the track must be a backdrop (pen won't write over sprites), or create clones of the skid marks. I only know how to do the first method, so here is a concept of it. Our car sprite will be named “vroom”, and our “direction” variable will be set to the car's direction.

whenclickedforeverpointindirectiondirectiongotovroomifkeyright arrowpressed?orkeyleft arrowpressed?thenstamp

Hope this helped. If i'm wrong, correct me.
how I did it was:
whenclickedforevergotocarpointindirectiondirectionofcarifXV>0.5orYV>0.5orXV<-0.5orYV<-0.5thencreatecloneofmyself
whenIstartasacloneshowrepeat10changeghosteffectby10wait0.1secsdeletethisclone
enochx
Scratcher
500+ posts

How do I make the car drift in one of my projects.

whenright keykeypressedturn?degrees
kingbob892
Scratcher
1 post

How do I make the car drift in one of my projects.

FrankieJrJr wrote:

whenclickedforeverifkeyright arrowpressed?thensetvelXto2repeatuntilnotkeyright arrowpressed?changexbyvelXrepeatuntilvelX=0 changevelXby-0.1changexbyvelX

Then Switch every negative number and every positive number and switch the right arrow keys to left.
CR7probro12t
Scratcher
1 post

How do I make the car drift in one of my projects.

how do I Make skid marks so they show when you drift and so they disappear after
GAMER_6O7
Scratcher
100+ posts

How do I make the car drift in one of my projects.

Guys this is an old topic make your own.

Powered by DjangoBB