Game Development Reference
In-Depth Information
Before you try this out, you might like to edit the Draw event of obj_skeleton and remove
the commented lines at the end of the event. Just delete the backslash ( // ) characters at the start
of each line (apart from the first one, which really is a comment). Now, try out the level again
and see the difference this makes. You can now see exactly what the skeletons can see: a green
line means the skeleton's view is obstructed and a red line means he can see you! (see Figure
12-7).
Figure 12-7. The red line indicates that the skeleton has seen Flynn. This is only displayed during
development to check that everything is working correctly and will not appear in the final game
It can be a bit hard to get very far now as an alerted skeleton makes himself very unhelpful
to your progress. Nonetheless, we still have to make the skeleton respond to our secret
weapon—the parrot.
Pesky Parrot
The parrot distraction mechanic needs a few loose ends tied up to make it all come together.
We'll trigger the pursuit of Archie through a collision event between obj_parrot and a skeleton,
which will put the skeleton into the attacking state, too. Skeletons will only remain in an
attacking state until the end of the animation cycle, but can be sent back into an attacking state
by another collision with Archie. As the parrot's distraction path is quite erratic, this can happen
randomly during an encounter. This gives the whole interaction an improvised feel, rather
than a scripted sequence of events that keeps repeating itself.
Search WWH ::




Custom Search