Game Development Reference
In-Depth Information
also allows for other developers or artists to work on different aspects
of the game without stepping on each other
'
s toes. When we get to
the code behind the engine, we
ll define the rules that asset files must
follow in order to work properly with the engine.
'
The Level XML
Here is what Fig. 14.2 looks like represented as XML. Note that to
make the wall nodes more readable, I have inserted carriage
returns between each column. In the final format, there is no rea-
son to have these and it is a nonstandard XML practice.
< level width= " 10 " height= " 10 " gridSquareSize= " 50 ">
< assets >
< asset file= " player.swf " / >
<
asset file=
"
enemies.swf
"
/
>
<
asset file=
"
items.swf
"
/
>
<
asset file=
"
environment.swf
"
/
>
<
/assets
>
<
player spriteClass=
"
Player
"
x=
"
2
"
y=
"
0
"
/
>
<
>
< enemy spriteClass= " Enemy1 " name= " enemy1 " x= " 5 " y= " 8 " / >
< /enemies >
< items >
enemies
< item spriteClass= " Key " type= " key " name= " key1 "
x= " 1 " y= " 5 " points= " 0 " / >
< item spriteClass= " Treasure " type= " treasure "
name= " treasure1 " x= " 2 " y= " 3 " points= " 100 " / >
< item spriteClass= " Treasure " type= " treasure "
name= " treasure2 " x= " 1 " y= " 8 " points= " 100 " / >
< item spriteClass= " Treasure " type= " treasure "
name= " treasure3 " x= " 6 " y= " 6 " points= " 100 " / >
< /items >
< portals >
< portal spriteClass= " LevelEndDoor " destination=
" nextLevel " x= " 5 " y= " 1 ">
< requirement type= " inventory " name= " key1 " / >
<
/portal
>
<
/portals
>
<
walls
>
<
wall spriteClass=
"
StandardWall
"
x=
"
0
"
y=
"
0
"
/
>
<
wall spriteClass=
"
StandardWall
"
x=
"
0
"
y=
"
1
"
/
>
<
>
< wall spriteClass= " StandardWall " x= " 0 " y= " 3 " / >
< wall spriteClass= " StandardWall " x= " 0 " y= " 4 " / >
< wall spriteClass= " StandardWall " x= " 0 " y= " 5 " / >
< wall spriteClass= " StandardWall " x= " 0 " y= " 6 " / >
wall spriteClass=
"
StandardWall
"
x=
"
0
"
y=
"
2
"
/
Search Nedrilad ::




Custom Search