Defining the track in a 2D racing game
- by Ivan
I am designing a top-down racing game using canvas (html5) which takes a lot of inspiration from Micro Machines. In MM, cars can move off the track, but they are reset/destroyed if they go too far.
My maths knowledge isn't great, so I'm finding it hard to separate 3D/complex concepts from those which are directly relevant to my situation. For example, I have seen "splines" mentioned, is this something I should read up on or is that overkill for a 2D game?
Could I use a single path which defines the centre of the track and check a car's distance from this line? A second path might be required as a "racing line" for AI.
Any advice on methods/techniques/terms to read up on would be greatly appreciated.