Game Development Reference
In-Depth Information
Figure 7-2.
Iteration 3's game screen
Updating and rendering player movement
(iteration 4)
Next, we are going to add the
update
and
render
functions to the game code. When we are done
with these, the player
Tank
will smoothly navigate the maze, moving from tile center to tile center,
negotiating tunnels like an expert tank commander.
In this section, we will be creating the updating and rendering portions of our game and including
only the code needed for the player. We will also update the variable definition section and the
runGame
function to add in the new calls to the
update
and
render
functions.
Let's get started right away. Once again, we are going to change to a new class name for this iteration.
This is the path for our new class in the Flash IDE:
/source/projects/notanks/flashIDE/com/efg/games/notanks/GameDemoIteration4.as
And this is the path in the Flex SDK (using Flash Develop):
/source/projects/notanks/flexSDK/src/com/efg/games/notanks/GameDemoIteration4.as