Matt,
finally tried this out and I like the look! However, for me the gameplay did
not work well at all. It was hard to get the player off the ground. It seems
like the physics were too fast on my machine, what kind of CPU do you have?
One hint for making any game is that you should either set a framerate
(e.g. 30 fps) or you should calculate the physics based on time
(distance = velocity*time, velocity = acceleration*time). Either way, you
need to factor time into your main loop, otherwise the game will play
differently on different speed machines.
In Broomsticks, I set a frame rate of 30 fps. Here is pseudo-code for
my main loop:
beforeTime = getCurrentTimeMilliseconds()
doSimulation()
elapsedTime = getCurrentTimeMilliseconds() - beforeTime
if (elapsedTime < 30)
sleep(30 - elapsedTime)
By checking the time at the start and end of each main loop iteration,
I can tell the game to sleep for an amount of milliseconds that will
result in a constant framerate of 30 fps. On a slow machine (e.g. 100 MHz),
the simulation may take close to the full 30 milliseconds. On a fast machine
(2 GHz), it may only take 2 milliseconds, but it will then sleep 28. As a
result, the game will play the same on both machines. The only difference is
that the first machine will be using most of its cpu whereas the second machine
will be hardly using it at all and can run other programs at the same time with
no problems.