Game Development Reference
It turns out that knowing the half-width and half-height of objects is extremely important for doing
certain kinds of advanced collision detection. Remember the solution to this screen boundary problem
because you'll use it to help solve a number of tricky problems throughout the course of this topic.
You can find the completed version of this code in the I]ej[O_naaj>kqj`]neao*]o file in this chap-
ter's source files.
Screen wrapping happens when an object disappears from one side of the screen and then reemerges
from the opposite side. This is quite a fun effect and very easy to implement. In fact, the logic that's
used to accomplish it is almost exactly the inverse of the logic you used to block movement at the
stage's edges. Let's try it out!
1. Change the conditional statements inside the kjAjpanBn]ia event handler to match the text in