A Flash Developer Resource Site

1. ## 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.

2. 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

3. how did you put the car drifting like that?

4. 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

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

6. 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.

7. 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

8. 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!

9. 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. Can someone paste the whole script of car that drifts.

11. I wrote this mini-tutorial source file a while ago:

12. Ozmic, what version of Flash mx 2004 you have? I cant open it in 7.0

13. Please see the attached FLA (F8).
This was the best I could accomplish.

14. it's so slow i couldnt make skidmarks without hitting the grass. and it's very loud, too )

15. OK!
-car sound setvolume reduced to 10%.
See the modified FLA.

16. sometimes if you make a game it make car rotate but not go, u need to change the flash player under 7

17. 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.

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

19. 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

20. I am still at it.
I have improved the FLA, and added speed coolbar.
Present frame rate set at 12.
You can play with FPS,car speed etc, if you want!!!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap