Game Development Reference
In-Depth Information
++AjaiuPsk
eb$ajaiuPsk9jqhh%
w
eb$ajaiuPsk*depPaopLkejp$^qhhap*t(^qhhap*u(pnqa%%
w
ajaiuPsk*oq^K^fa_p*iapan*se`pd)9-,7
eb$ajaiuPsk*oq^K^fa_p*iapan*se`pd8-%
w
ajaiuPsk*oq^K^fa_p*opkl$%7
naikra?deh`$ajaiuPsk%7
ajaiuPsk9jqhh7
y
naikra?deh`$^qhhap%7
^qhhap9jqhh7
y
y
y
y
y
Let's take a walk through the events of the game, starting with how to make the lh]uan object move.
Moving the player
Control of the lh]uan object is delegated to the Lh]uan class. It's almost identical to code that you
looked at in Chapters 6 and 7, except for one important detail. In the previous versions of this code,
the lh]uan properties were referred to like this:
lh]uan*t
lh]uan*u
In this code, it's referred to just like this:
t
u
All the code in this class is bound directly to the Lh]uan symbol in the Library . That means that it's run-
ning inside the lh]uan object itself . Because of that, t and u refer directly to the lh]uan object. This is
also the same for all the other properties in the Lh]uan class, such as [rt and [ru.
You can also use the keyword pdeo to make it clear. The properties in the Lh]uan class can also be
written like so, making it obvious that you're talking about this object :
pdeo*t
pdeo*u
pdeo*[rt
pdeo*[ru
Whenever you see the keyword pdeo, remind yourself that it refers to the object the class is bound
to: this object .
 
Search Nedrilad ::




Custom Search