Class TBart (unit Bart) |
****** * * Module: Bart * Author: Joe Kessler * IntegrationWare - A New Generation of Extraordinary PC Solutions * www.integrationware.com * * Purpose: * * Implementation of our hero, Bart. * * Details: * * This module defines most of the look and behavior of Bart, the hero of * the game. The TBart class is derived from TVisibleObject, which * provides the core functionality that TBart requires for linking into * the rest of the universe. *
Constructors |
Functions |
Properties |
Events |
Variables |
Constructors |
*** Our constructor ***
Functions |
Bart will start under pilot control by default. Notice that Bart does NOT appear on the screen until there is a safe clearing. During this period of time he is not subject to collisions. The following list of states is used to achieve this behavior for Bart. Notice that ALL of these behaviors are implemented individually by TVisibleObject. The state queue simply gives us a way to queue the behaviors in an arbitrary order.
Get the current speed of the object, and increase the speed by a fixed amount to account for the momentum provided by the thrusters. We will also cap off at a maximum allowed speed.
Missle cannon control.
Make the engine flames visible based upon the given firing state.
Handle Collisions.
Record the time the missle was squeezed off, so we can determine when the cannon is ready with another one.
Decrease the speed by a fixed percentage as if there were drag.
Method to handle keyboard messages.
This method gets triggered in response to input event from the current input device. Bart uses these messages to respond to user input.
Engine control.
Wrap around if we've gone off the screen.
Movement methods.
Perform default procesing.
Properties |
Events |
Variables |
Time that Bart last fired a missle.
TRUE when the engine is firing.
Handles to the shapes comprising Bart.
TRUE when the cannon trigger is engaged.