Game Development Reference
In-Depth Information
// The airplane cartoon moves across the screen at a
// constant velocity of 20 pixels/second.
airplaneX = airplaneX + 20.0*timeIncrement;
// Update the display.
updateDisplay();
If the elapsed time that the laser has been in contact with the airplane exceeds the time
required to absorb 10,000 J/cm 2 , then the airplane explodes. The simulation stops and, as
shown in Figure 14-9, an explosion cartoon is shown on the screen.
// If the time that the laser has been on the airplane is
// greater than the necessary time to destroy the airplane,
// stop the simulation.
if ( elapsedTime > explosionTime ) {
gameTimer.stop();
}
Figure 14-9. The laser has destroyed the airplane.
Creating Your Own Laser Systems
Up to this point in this chapter, we have been discussing the performance and characteristics
of laser systems that are either in existence today or are projected to be built in the next few
years. But you as a game programmer don't have to be restricted by what is possible at this
point and time. Like all other technology, laser technology will improve dramatically in the
coming years. There is no reason to think that at some point in the future backpack-sized 1 MW
combat lasers won't be available, and there is no reason why you can't place such a device into
one of your game simulations.
Search WWH ::




Custom Search