Game Development Reference
In-Depth Information
da]hpd*iapan*se`pd))7
eb$_khheoekjD]oK__qnna`%
w
o_kna''7
iaoo]ca@eolh]u*patp9Opnejc$o_kna%7
_khheoekjD]oK__qnna`9pnqa7
y
y
ahoa
w
ajaiu*ckpk=j`Opkl$-%7
_khheoekjD]oK__qnna`9b]hoa7
y
++?da_gbknaj`kbc]ia
eb$da]hpd*iapan*se`pd8-%
w
iaoo]ca@eolh]u*patp9C]iaKran7
y
eb$o_kna:91%
w
iaoo]ca@eolh]u*patp9Ukqskj7
y
eb$lh]uan*depPaopK^fa_p$s]hh%%
w
lh]uan*t)9rt7
lh]uan*u)9ru7
y
y
5. Save the I]ej[Lh]ucnkqj`*]o file and test the project. Try to move the lh]uan object through
the wall. You can't; it blocks you in each direction.
The logic behind this is exactly the same as the logic you used to prevent the lh]uan object moving
off the hill. But you might have noticed something important: it works, but it doesn't work well. The
reason it doesn't work well is extremely important to understand.
Move the lh]uan object to each side of the s]hh object and look carefully at how close the two
objects come to one another. There's probably either a small gap or a large gap. If you're really lucky,
they might meet almost exactly. None of the gaps will be consistent. Figure 7-35 shows an example of
how this looks in my program.
 
Search Nedrilad ::




Custom Search