A Flash Developer Resource Site

Thread: [F8] Realisic Car Game

1. [F8] Realisic Car Game

Could someone please help me out with a uncommon code?
Atleast I think it's uncommon...
Anyways to the main point, I was wanting a code as I was making a sprite set for my game. I have praticily everything except the follow codes.
• Realistic Car movement
• Crash on to collisions

For the car movement, What I think is realistic is. When you press up/accelerate the car will have a real aceleration which starts slow and moves faster gradualy but a certain speed that can be modified Also when you stop pressing up/accelerate, The car will soon slow down eventualy.

For the crash effect. Is it possible to get a code that when a movie clip hitTest with the wall/colliso, the car will bounce off the wall I've tried to get the code somewhere but I didn't work realisticly.

Thanks so much in advance!!

2. I'm guessing you're somehow using velocity variables?
If so, set them both opposite of what they were (ex: vx = -vx)
and the car will rebound backwards at exactly the same speed. Sometimes this gives a problem where the car stays in the wall after the collision and vibrates around... so first take back your last movement by subtracting
car._x -= vx
car._y -= vy
and then change the velocities to negative.

You could also thinking about adding some spin, or changing the directions by a little bit (use math.random() to make the car not travel backwards at exactly the same angle as it came in at) to make it seem more realistic.
Good luck
Mavrisa

3. RE: [F8] Realisic Car Game

No clue man - sorry.

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

Click Here to Expand Forum to Full Width