# Drift Physics

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• 12-08-2005, 08:23 PM
MasterRex
Drift Physics
Hi. My name is Rex, and I was reffered here by a freind.

I am an aspiring flash programmer, and I think I am doing alright for what I have done so far.

http://media.putfile.com/DriftDemov3

My question(s)....
How do I affect the "force" of the car to slow down over time?

How can I make skid marks that stay where they were made?

How can I make a points system based on the angle of the car?

Any help/crits on my game would be direly appreciated.
• 12-09-2005, 04:22 AM
shipstern
It depends on how you are representing your dynamics.
Are you using Vectors and how are you arriving at your Position. ie
Acceleration=Force/Mass
Velocity+=Acceleration.
New_Position = Old_Position+Velocity

There are a number of methods for calculating friction or drag, the simplest is a penalty on Velocity ie drag is directly proportional to the velocity of the car. ie
Acceleration=Force/Mass
Velocity+=Acceleration.
New_Position = Old_Position+(Velocity*=drag).

Shipstern
• 10-21-2007, 05:20 AM
lamaman
how did you put the car drifting like that?
• 10-24-2007, 03:02 AM
rhys_the_Cool
it's great but how did you do it? i am making a game like that 2 but is there a way to stop the car after a whle? when i play it keeps going into the wall and out over and over
• 10-24-2007, 03:11 AM
rhys_the_Cool
are you tring to find this game http://www.jeffwu.net/games/drift.swf that might be helpful somehow
• 10-24-2007, 10:27 AM
lamaman
Quote:

Originally Posted by rhys_the_Cool
are you tring to find this game http://www.jeffwu.net/games/drift.swf that might be helpful somehow

Yes I want these kind of physics into my game.
• 10-25-2007, 02:22 AM
rhys_the_Cool
yes but how did master rex get his drifty car game and how did that game get it's drift physicis is the real question
• 10-25-2007, 12:43 PM
newblack
this isn't drifting so much as letting the car rotate without affecting its momentum- a car's momentum against the turned direction is what causes drifting, but not so exaggerated obviously.

you have to implement drag. shipstern demonstrated a very simple means to do this. if that doesn't make sense, you probably won't have much luck making a car game!
• 10-26-2007, 01:47 AM
realMakc
Quote:

Originally Posted by MasterRex
How do I affect the "force" of the car to slow down over time?

Code:

```// once per tick force *= 0.9;```
• 10-27-2007, 06:22 AM
lamaman
Can someone paste the whole script of car that drifts.
• 11-02-2007, 11:01 AM
ozmic66
I wrote this mini-tutorial source file a while ago:
• 11-02-2007, 11:06 AM
lamaman
Ozmic, what version of Flash mx 2004 you have? I cant open it in 7.0
• 11-06-2007, 01:25 PM
Eager Beaver
Please see the attached FLA (F8).
This was the best I could accomplish.
• 11-06-2007, 03:08 PM
realMakc
it's so slow i couldnt make skidmarks without hitting the grass. and it's very loud, too )
• 11-06-2007, 09:28 PM
Eager Beaver
OK!
-car sound setvolume reduced to 10%.
See the modified FLA.
• 11-08-2007, 03:37 AM
rhys_the_Cool
sometimes if you make a game it make car rotate but not go, u need to change the flash player under 7
• 11-08-2007, 10:23 AM
Eager Beaver
Quote:

Originally Posted by rhys_the_Cool
sometimes if you make a game it make car rotate but not go, u need to change the flash player under 7

I have published the movie in Flash 8, Flash player 8.
Use UP, DOWN arrow keys to move the car.
Use LEFT, RIGHT arrow keys to rotate the car.
For better performance please change the frame rate (fps)
from the existing 12 to 24.
• 11-15-2007, 06:59 AM
rhys_the_Cool
the game is kinda pointless but it shows the drift physics.
PM if you want the starting of need for speed carbon flash game
• 11-15-2007, 11:32 AM
Eager Beaver
Quote:

Originally Posted by rhys_the_Cool
the game is kinda pointless but it shows the drift physics.PM if you want the starting of need for speed carbon flash game

What I have shown is only an illustration of drift physics.
You can play the game by logging on to this link: Racing Car
• 12-22-2007, 09:33 AM
Eager Beaver
I am still at it.:) :)
I have improved the FLA, and added speed coolbar.