This web page has been designed to work with a browser that supports Dynamic HTML or Cascading Style Sheets
Geo23
Geo25
missileG
Scramble

This advanced tutorial continues the instructions in Lock and Load to add a target UFO and Explosion. It assumes you have a basic understanding creating Objects. Complete the Lock and Load tutorial and use it as the starting point for this tutorial.

Method


1. Load the Lock and Load IMS file. It is the starting point for this tutorial.
2. Create the UFO Object with the Sprite command. The UFO GIF "ufo.gif" is located in the Clip Art directory. Rename it UFO with the Object Editor.
3. Create an ellipse and position to the right of the F14 and rename it UFOPath.
4. Select the UFO Object and use the Action editor to assign the Ellipse as its path. The preview button should display the UFO following the ellipse path. The missile should be able to intersect the UFO when it is fired from the F14.
5. Create an Explosion Object with the sprite command and rename it Explode with the Object editor. The Explode GIF is called "firea.gif" and is also located in the ClipArt directory. Note that it will barely be visible since the first frame in this animated gif is mostly transparent.


We now want to cause the UFO to disappear and the Explosion to appear when the UFO is hit with the missile. This is done with a Behavior that is triggered when the UFO and missile intersect. The Behavior will trigger both the UFO and Explosion Active. When Active, the Explosion will become Visible while the UFO will become Invisible. The Behavior will become Inactive a short time later with a timer.


1. Select the UFO and open the Behavior Dialog. Confirm creating a new behavior and rename it UFOHitB
2. Select the "Trigger Event" Dialog and check the "When Object Enter" check box in the 'Dynamic Triggers' section. From the drop down box select the "missile" Object. This will cause the missile to trigger this Behavior when it enters the bounding box of the UFO.
3. Select the "End Event" dialog tab and check the "At specified Time" check box under 'Dynamic Triggers". Set the time to 20 in the adjacent edit box. This will terminate this Behavior approximately 2 seconds after it has been triggered. The time may vary slightly from machine to machine and Browser to Browser.
4. Select the 'Actions' tab dialog and Uncheck the "Visible" check box in the 'When Triggered Active' section. Make sure that both "Motion" check boxes and the "Visible" check box in the "When Not Active" section are left checked. This will cause the UFO to disappear when it is Intersected by the missile but it will continue to follow the ellipse path.


If you preview the presentation now, the UFO will disappear when it is intersected with the missile and will then reappear approximately 2 seconds later. We now want to do the opposite to the explosion which is attached to the UFO.


1. Select the Explosion Object and select the Behavior dialog. Confirm the new Behavior and rename it ExplodeE.
2. Since this behavior will be triggered On and Off by the UFO Behavior, there are no "Trigger Event" or "End Event" settings to be made. Select the "Actions" tab dialog and set the Visibility checked "When Triggered Active" and Unchecked "When Not Active". Leave the "Reset Path" and "Reset Triggers" left checked under the "'When Not Active' section and unchecked 'When Triggered Active'.


The last thing to do is have the UFO Behavior trigger and Reset the Explosion Behavior.


1. Return to the Behavior 'Selection' tab dialog and from the 'Current Event' drop down box select the "UFOHitB" Behavior.
2. Select the 'Actions' tab and check the "Trigger Behavior" check box and select the "Explode" behavior from the drop down box.
3. Check the 'Reset Behavior' check box in the 'When Not Active' section and again select the "Explode" Object. Exit the dialog.


If you preview now, the UFO should explode whenever it is hit with a missile.
UFOG
explodeG
Use the "m" key to fire your missile.
Web Engine tutorials