Game Development Reference
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.