Game Development Reference
In-Depth Information
y
++Cappano]j`oappano
lq^he_bqj_pekjcapeo=nia`$%6>kkha]j
w
napqnj[eo=nia`7
y
lq^he_bqj_pekjoapeo=nia`$sa]lkjOp]pa6>kkha]j%
w
[eo=nia`9sa]lkjOp]pa7
y
y
y
The most important new directive is this one:
l]najp*]``?deh`$jas>qhhap[Bkqn@ena_pekjo$[`ena_pekj%%7
It sends the value of the [`ena_pekj property directly to the >qhhap[Bkqn@ena_pekjo class. That class then
uses it (ql, `ksj, habp, or necdp) when it creates the bullet instances to initialize its direction.
For this to work, you need to make an important addition to the >qhhap class. It needs a construc-
tor parameter so the [`ena_pekj value can be accepted and used in the class. Here's the >qhhap[
Bkqn@ena_pekjo class. The constructor parameter has been highlighted—see if you can figure out how
it uses that information in the code:
l]_g]ca
w
eilknpbh]od*`eolh]u*Ikrea?hel7
eilknpbh]od*arajpo*Arajp7
lq^he__h]oo>qhhap[Bkqn@ena_pekjoatpaj`oIkrea?hel
w
lner]par]n[rt6ejp7
lner]par]n[ru6ejp7
lner]par]n[`ena_pekj6Opnejc7
lner]par]n[op]caDaecdp6qejp7
lner]par]n[op]caSe`pd6qejp7
lq^he_bqj_pekj>qhhap[Bkqn@ena_pekjo$ sa]lkj@ena_pekj6Opnejc %
w
[`ena_pekj9sa]lkj@ena_pekj7
]``ArajpHeopajan$Arajp*=@@A@[PK[OP=CA(kj=``a`PkOp]ca%7
y
lner]pabqj_pekjkj=``a`PkOp]ca$arajp6Arajp%6rke`
w
++Oappda^qhhap#oop]nplkoepekjpk^apda
++o]ia]opdasa]lkj#o
t9Ikrea?hel$l]najp%*sa]lkj*t7
u9Ikrea?hel$l]najp%*sa]lkj*u7
 
Search Nedrilad ::




Custom Search