A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Drift Physics

  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    28

    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.
    e6750 .:. 2gb ddr2 800 .:. 8800gts g92
    masterrex.com / dreamingofdelusion.com
    <always up for anything fun>

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Posts
    524
    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
    Last edited by shipstern; 12-09-2005 at 04:41 AM.

  3. #3
    Banned
    Join Date
    Oct 2007
    Location
    Estonia
    Posts
    16
    how did you put the car drifting like that?

  4. #4
    Member
    Join Date
    Oct 2007
    Posts
    52
    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. #5
    Member
    Join Date
    Oct 2007
    Posts
    52
    are you tring to find this game http://www.jeffwu.net/games/drift.swf that might be helpful somehow

  6. #6
    Banned
    Join Date
    Oct 2007
    Location
    Estonia
    Posts
    16
    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.

  7. #7
    Member
    Join Date
    Oct 2007
    Posts
    52
    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. #8
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246
    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. #9
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    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;
    who is this? a word of friendly advice: FFS stop using AS2

  10. #10
    Banned
    Join Date
    Oct 2007
    Location
    Estonia
    Posts
    16
    Can someone paste the whole script of car that drifts.

  11. #11
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    I wrote this mini-tutorial source file a while ago:
    http://board.flashkit.com/board/showthread.php?t=688426
    Pixelwave Flash-based iPhone framework
    iPhone Games: Flyloop | Freedom Run

    Twitter: Oztune

  12. #12
    Banned
    Join Date
    Oct 2007
    Location
    Estonia
    Posts
    16
    Ozmic, what version of Flash mx 2004 you have? I cant open it in 7.0

  13. #13
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Please see the attached FLA (F8).
    This was the best I could accomplish.
    Last edited by Eager Beaver; 11-06-2007 at 09:22 PM.
    <signature removed by admin>

  14. #14
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    it's so slow i couldnt make skidmarks without hitting the grass. and it's very loud, too )
    who is this? a word of friendly advice: FFS stop using AS2

  15. #15
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    OK!
    -car sound setvolume reduced to 10%.
    -drift/brake sound added.
    -drift button added.
    See the modified FLA.
    Attached Files Attached Files
    <signature removed by admin>

  16. #16
    Member
    Join Date
    Oct 2007
    Posts
    52
    sometimes if you make a game it make car rotate but not go, u need to change the flash player under 7

  17. #17
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    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.
    <signature removed by admin>

  18. #18
    Member
    Join Date
    Oct 2007
    Posts
    52
    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. #19
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    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
    <signature removed by admin>

  20. #20
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    I am still at it.
    I have improved the FLA, and added speed coolbar.
    Please see the attached FLA(F8-ZIPPED).
    Present frame rate set at 12.
    You can play with FPS,car speed etc, if you want!!!
    Attached Files Attached Files
    Last edited by Eager Beaver; 12-22-2007 at 09:50 AM.
    <signature removed by admin>

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center