Game Development Reference
In-Depth Information
requestShip();
m_firstTime = false;
addChild(m_track);
}
else {
addChild(m_track);
m_track.startRace();
}
}
The implementation is no way close to what you can deploy as a real game. There are
a lot of improvements that can be made, especially for players owning and upgrading
their ships. Also, a complete item system should be implemented with interesting
effects on the ship and the gameplay as a whole. But the implementation presented
here takes care of all the basic functionality of a typical, fast-action racing game.
Summary
We explored useful techniques such as quadrants that allow us to have arbitrary,
long racetracks and also the masking technique for us to quickly offer a wide
variety of spaceships.
You should now be familiar with controlling the ships' movements, adding items on
the track, and moving them at the ships' speed. We also learnt how having a main
game loop and calling update methods on objects from within the loop simplifies
the overall implementation.
We looked at the challenges regarding the lag and updating the position of others
ships' positions on our own screen. We also saw a simple implementation of a
mini-map that not only gives players an idea of how far along the racetrack they
have progressed, but also how near or far the other ships are with respect to
their own ship. Furthermore, we got acquainted with the radar object that shows
oncoming asteroids before they appear on the screen.
 
Search WWH ::




Custom Search