The root
I've been working on this project for a few days, so I figured it would be useful to
put together a record of my work for my own use and so others can learn from this project.
I plan to release all the source code for this project, so everyone can tweak it and
learn from it. Share the wealth! :)
So far I've created a class called Car which is the underlying car simulation, as shown below.
The code below is what simluates the car you can play about with in the two Flash movies to the right.
I'm now thinking about changing the way it works, so instead of having an acceration property I
want to put in a weight and engine power properties. These two properties will allow
the acceration to be calcuated.
In addition the weight will be useful for collisions in order to work out who comes off worst :)
I've got the basic tiling system working quickly and efficiently - which was a task in itself! The
last time I wrote a tiling engine it turned into a pile of crap, but this time it works great!
At the moment it just uses the same tile for the ground, I need to make it load different tiles
from a map file in order to simluate a city.
However my next move is to write a camera class, so that it'll be easy to tell it what to look
at. Also I want the camera to zoom out when the car is moving fast, then to zoom back in when
it slows down. I think this might be a little tricky, but it'll give me a really powerful
game engine that I can use on other projects when I pull it off.
|
Prototype 2: A tiling engine moves the ground under the car, rather than moving the car itself.
Prototype 1: A car simulation. Up = accelerate, down = brake, left & right steer.
|