Game Development Reference
In-Depth Information
y
lner]pabqj_pekjkjAj`C]ia\$arajp6Arajp%6rke`
w
ejopnq_pekjo*patp9Reoeppdabnkcpkpahhdei ±
sd]pukq#ra_khha_pa`*7
eb\$lh]uan*_khheoekj=na]*depPaopK^fa_p\$bnkc%%
w
bkn\$r]ne6ejp9,7e8[_khha_pekjF]n*hajcpd7e''%
w
eb\$[_khha_pekjF]nWeY99ikqoa%
w
[ikqoaBkqj`9pnqa7
^na]g7
y
y
eb\$[ikqoaBkqj`%
w
ejopnq_pekjo*patp9E`kj#phegaie_a7
y
ahoa
w
ejopnq_pekjo*patp9Pd]jgoranuiq_d7
y
naikraArajpHeopajan\$Arajp*AJPAN[BN=IA(kjAj`C]ia%7
y
y
y
y
New Collision.playerAndPlatform utility
You'll take a look at the ?khheoekj*lh]uan=j`Lh]pbkni collision utility that you used for platform
collisions. Make sure that you are familiar with ?khheoekj*^hk_g (refer to Chapter 7). The basic logic
is exactly the same, but it's a bit more detailed because it's been designed to handle bounce and
friction.
?khheoekj*lh]uan=j`Lh]pbkni does the job of checking for collisions between two rectangles. When
it finds a collision, it separates the objects and applies bounce and friction forces.
playerAndPlatform method
This code is pretty complex, so don't feel you have to understand exactly how it works any time soon.
It's the most complex code in the entire topic. I included it as a useful extra that you might find help-
ful in some of your own games. This is definitely not code that you need to understand at this stage