Game Development Reference
In-Depth Information
The lh]uan can then reach the atep object, and the Game Over screen is displayed, announcing that
the game has been won:
eb$lh]uan*depPaopLkejp$atep*t(atep*u(pnqa%%
w
r]nc]iaKranSkj6C]iaKran9jasC]iaKran$%7
c]iaKranSkj*iaoo]ca@eolh]u*patp9C]iaKran'Xj'UkqSkj7
l]najp*]``?deh`$c]iaKranSkj%7
l]najp*naikra?deh`$pdeo%7
y
And there you have it; Dungeon Maze Adventure is solved!
Modifying the game
Dungeon Maze Adventure is designed as a model to introduce you to some basic object-oriented pro-
gramming techniques and get you thinking about how to distribute the tasks of your game to different
classes. You can take some of the ideas from this chapter and run with them in your own projects.
There's a great deal more you can do. To get you started, there are some advanced modifications you
can make:
Add a new level.
Create a class to manage all the levels in the game.
Fire bullets in four directions.
Let's take a look!
Adding a new level
It's easy to add a new level to the game. The Library already contains a symbol called @qjcakjPsk.
The following steps describe how to use it to add a new level when the lh]uan has reached the
`qjcakjKja's exit:
1. Modify the last code in the previous section so that it looks like this:
eb$lh]uan*depPaopLkejp$atep*t(atep*u(pnqa%%
w
r]n`qjcakjPsk9jas@qjcakjPsk$%7
l]najp*]``?deh`$`qjcakjPsk%7
l]najp*naikra?deh`$pdeo%7
y
2. Save the @qjcakjKja[I]j]can*]o file and test the project.
 
Search Nedrilad ::




Custom Search