Game Development Reference
In-Depth Information
7. Add an kj?khheoekjSepdLh]uan event listener to the bhu, ^aa, ikomqepk, and ikqoa objects in
the constructor method (these objects all share the same event listener):
bhu*rt9,7
bhu*ru9,7
bhu*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj>qcIkra%7
bhu*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj?khheoekjSepdLh]uan%7
++^aa
^aa*rt9,7
^aa*ru9,7
^aa*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj>qcIkra%7
^aa*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj?khheoekjSepdLh]uan%7
++ikomqepk
ikomqepk*rt9,7
ikomqepk*ru9,7
ikomqepk*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj>qcIkra%7
ikomqepk*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj?khheoekjSepdLh]uan%7
++ikqoa
ikqoa*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kj?khheoekjSepdLh]uan%7
8. Add the kj?khheoekjSepdLh]uan event handler:
lner]pabqj_pekjkj?khheoekjSepdLh]uan$arajp6Arajp%6rke`
w
r]n_khha_pekjEpai6Ikrea?hel9arajp*p]ncap]oIkrea?hel7
eb$[_khha_pekjF]n*hajcpd8/%
w
eb$lh]uan*depPaopLkejp$_khha_pekjEpai*t(_khha_pekjEpai*u(pnqa%%
w
pdeoWepai>kt'[_khha_pekjF]n*hajcpdY*]``?deh`$_khha_pekjEpai%7
_khha_pekjEpai*t9,7
_khha_pekjEpai*u9,7
[_khha_pekjF]n*lqod$_khha_pekjEpai%7
++Naikraheopajanokb_khha_pa`epaio
eb$_khha_pekjEpai9ikqoa%
w
_khha_pekjEpai*naikraArajpHeopajan$Arajp*AJPAN[BN=IA( ±
kj>qcIkra%7
y
_khha_pekjEpai*naikraArajpHeopajan$Arajp*AJPAN[BN=IA( ±
kj?khheoekjSepdLh]uan%7
y
y
y
 
Search Nedrilad ::




Custom Search