Game Development Reference
In-Depth Information
5. Click the look button. The cat now rolls its eyes, as shown in Figure 4-16.
Figure 4-16. Click the look button, and the cat surveys the scene.
The code hasn't done anything really new, but you haven't yet seen all these things working in com-
bination like this before.
The code is targeting child objects of the _]p:
dehhL]ca*_]p* habpAua *nkp]pekj'9.,7
dehhL]ca*_]p* necdpAua *nkp]pekj'9.,7
The habpAua and necdpAua are children (subobjects) of the _]p, which itself is a child of dehhL]ca.
You can easily create very complex interactive objects simply by adding more subobjects and targeting
their various properties.
The nkp]pekj property works much like the other properties that you've looked at so far:
dehhL]ca*_]p*habpAua* nkp]pekj'9., 7
dehhL]ca*_]p*necdpAua* nkp]pekj'9., 7
The nkp]pekj property accepts values in degrees of a circle, so each object has 360 of them that you
can work with. Positive values rotate the object clockwise, and negative values rotate it counterclock-
wise. The center of the rotation is the object's own center registration point. That was why it was
important to make sure that the eye graphic was centered on the Aua symbol's registration point for
the effect to look realistic.
Search Nedrilad ::

Custom Search