Game Development Reference
In-Depth Information
Have a quick look back at the @qjcakjKja[I]j]can class and you'll notice that you still use lh]uan*t
and lh]uan*u in this game. That's because the lh]uan object is inside the @qjcakjKja symbol, which
the @qjcakjKja[I]j]can class is bound to. Figure 8-16 illustrates this.
DungeonOne_Manager Class
Player Class
player.x
player.y
x
y
this.x
this.y
or
Figure 8-16. The Player class is written from a first-person perspective,
so it doesn't need the qualifier “player” to refer to its own properties.
The dungeon needs to know which of the many objects it contains you're
refering to, so you need to add the object name in front of the property
you're targeting.
The other difference is that all properties and methods of the Lh]uan class are now lner]pa. Here's
the lh]uan class in its entirety:
l]_g]ca
w
eilknpbh]od*`eolh]u*Ikrea?hel7
eilknpbh]od*arajpo*Gau^k]n`Arajp7
eilknpbh]od*qe*Gau^k]n`7
eilknpbh]od*arajpo*Arajp7
lq^he__h]ooLh]uanatpaj`oIkrea?hel
w
lner]par]n[rt6ejp7
lner]par]n[ru6ejp7
lner]par]n[lh]uanD]hbSe`pd6qejp7
lner]par]n[lh]uanD]hbDaecdp6qejp7
lner]par]n[d]oGau6>kkha]j7
lq^he_bqj_pekjLh]uan$%
w
]``ArajpHeopajan$Arajp*=@@A@[PK[OP=CA(kj=``a`PkOp]ca%7
y
lner]pabqj_pekjkj=``a`PkOp]ca$arajp6Arajp%6rke`
w
[rt9,7
 
Search Nedrilad ::




Custom Search