Home Games WIP Examples User Dir Affiliates Forums IRC FAQ Rules Terms Register

Username:
Password:
Skidmark Physics
This example shows 2 things - how to make realistic car skidding physics, and how to make skidmarks The physics part is based on the fact that a car has the tendency to swing it's direction to the axis it is pointing along. This is because of the grip of the tires, and the fact that the rolling friction only reduces friction along that axis. The faster the car goes, the less the car can turn per distance traveled - and as you get slow, the car turns easier. When you get going fast enough, the car will start to slide, and will point a direction other than that of the axis the car is pointing along. Depending on the speed, the car's direction will orient itself along that axis once more. If the car keeps turning, the direction can never catch up and orient itself correctly, and thus you have skidding. The skidmarks work by drawing a trianglelist using a ds_list as a data feed. Each separate tread is kept in it's own ds_list per skid. The ds_list keeps 3 variables - x,y,and angle, and reads them off for the skidmark.
Updated
For you non-registered people, I have done the impossible - I created my very own unregistered-primitives script just for this! and ported over image angle to an image index thing of a rotated sprite! I also created alpha removal, so now, if you want, the skidmarks disappear slowly! And 2 executables are also included! Just about all of the code is commented.

DOWNLOAD NOW
Information
Language:
Author:
Date:
Downloads:
Comments:
Rating:
GM 6
DesertFox
Jun 30, 2006
1517
38
9.1 (20 votes)

first prev 1 2 next last

cool, i started messing around with this
#21 Posted by gamerman on July 01, 2006 at 08:48 am

>_< i forgot to rate it
#22 Posted by gamerman on July 01, 2006 at 08:50 am

Whoo, fun, but the brakes don't seem to actually slow down the car. =|
#23 Posted by Hootiehoo on July 01, 2006 at 11:38 am

They do, and just increase brakefric if you want to.
#24 Posted by DesertFox on July 01, 2006 at 12:12 pm

Updatz00red!
#25 Posted by DesertFox on July 01, 2006 at 03:57 pm

It seems that the unregist one still uses ds_list finctions >_>
#26 Posted by _Player_ on July 01, 2006 at 10:19 pm

What?!? Ds_lists are registered, too? O_o Data structures are core! Neccessity! You'll have to change it to arrays. It shouldn't be too hard. I'm about to go camping, so I can't do it.
#27 Posted by DesertFox on July 02, 2006 at 01:16 am

lol
#28 Posted by _Player_ on July 02, 2006 at 05:54 pm

I love this. THANK YOU!!!! 10/10 - very helpful
#29 Posted by Acid on July 06, 2006 at 08:50 pm

That's cool that you made the u_list thing, now unregistereds can use this... 3rd example like this but probably the best one. Just for the record the other ones were by Rhys Andrews and Radnom Games.
#30 Posted by Zac1790 on July 07, 2006 at 08:24 pm

can you make a 3d verson of this it would be a great edition to my 3d racing game i'm making? oh and 10/10
#31 Posted by Jax on July 17, 2006 at 01:43 pm

very nice
#32 Posted by mesenberg on August 01, 2006 at 07:50 pm

:D
#33 Posted by Az on September 20, 2006 at 02:56 pm

Quote
can you make a 3d verson of this it would be a great edition to my 3d racing game i'm making? oh and 10/10
Wow, that was stupid. Nothing of the code would be the same, meaning it would be another example. Think before you type please.
#34 Posted by dabridge on November 04, 2006 at 12:16 am

pretty damn awesome! 9/10
#35 Posted by Virulent Horizon on March 13, 2007 at 03:15 pm

It has good car physics, but the skidding wasn't necessarily that real. The skids shouldn't appear all the time I think... It was rather cool though...uhh....yeah...9/10 (hope 64d rating system doesn't lower it to 8...)
#36 Posted by Crane-ium on March 31, 2007 at 05:28 pm

Totally awesome! 10/10 xD
#37 Posted by Roy on July 29, 2007 at 11:38 pm

first prev 1 2 next last
RAGE!
Help
A Trip to Hell in Search of Love
Hello, Tornado
Standards and Bottlenecks
hello again
Popcorn!
It's almost voxel, but still 2d
Rock Paper Scissors Xtreme
Underused Video Game Themes/Genres?
Voxel Venture, and a troll story...
Revenge is best served with a side of
GARGOYLE RANCHING SUPERTIME
The story of my umbrella
Nederlandse blog
Guests: 19
Infinity_Plus09:41
Kilin09:40
thernz09:35