Basically I’m attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I’m using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I’m happy with it (although eventually I’ll upgrade to dynamic paths and track builder)
The problem I’m having is that of getting the car to ‘realistically’ skid out on corners depending on speed - I’m doing a little calculation where I work out the difference between the car’s previous _rotation and the car’s current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old ‘smooth preloader’ tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go ‘full pelt’ round the track and you’ll see it happen in the top left (just past the top left corner)
The problem is something to do with how i’m calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?