Oh, sorry to sound daunting, but my track collision code is 585 lines long! No simple tests are going to do it for you. I feel that my code is very efficient also and that it runs really well. The reason 585 lines is efficient is because of it's tree structure. With the first test, you cut the remaining time in two. With a few more concluding tests, you've really only executed about 20 commands, all of which are simple arithmetic math, not built-in DB functions. There are just so many possibilities to test for with this type of game's collision code. Consider these tests:
* Hitting the ground below?
> Is the block a special block or a normal block?
> Is the block a tunnel (sliding off the edge)?
* Hitting a block above
> Is the block above a solid?
> Is the block above a tunnel?
> Is the player within the bounds of the tunnel walls
* Hitting a block to the left
* Hitting a block to the right
* Hitting a block in front
> Is the block solid?
> Is velocity fast enough to explode the car?
> Is the block a tunnel?
> Is the player withing the tunnel cavity?
> If not, is he hitting the side walls from the front?
> Is he hitting the side walls from the side (inside tunnel)?
> Is he hitting the tunnel roof from the front?
> Is he hitting the tunnel roof from underneath?
> Is the player grazing the corner of the block ahead?
If so, bump the player over a tad so he won't explode.
There's a LOT to consider!
Now that I think about it, I'm glad I did all this, but I would
hate to do it over again from scratch!