This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

Difference between revisions of "Game object"

From SuperTux
Jump to: navigation, search
 
Line 7: Line 7:
  
 
The class also contains a flag that indicates if the object should be removed at the end of the frame. You can call remove_me() to set this flag.
 
The class also contains a flag that indicates if the object should be removed at the end of the frame. You can call remove_me() to set this flag.
 +
 +
  
 
== InteractiveObject ==
 
== InteractiveObject ==

Revision as of 00:44, 5 April 2005

GameObject

A diagram illustrating the planned design for the GameObjects

This is the most basic class for objects in the game. Nearly everything should inherit from this class. All GameObjects are stored in a list by the engine. This list will be traversed 2 times per frame. First the action function is called on each object, and then the draw function of each object is called.

The class also contains a flag that indicates if the object should be removed at the end of the frame. You can call remove_me() to set this flag.


InteractiveObject

These are objects you can interact with. The objects will have an area in the world. And you can send interaction events to them. Typicall interaction events will be activate/push, ~EnterArea/touch, ~LeaveArea, hit with object

MovingObject

This class provides a position and functions for collision detection. All Moving objects are held in a separate list by the engine which is also traveled once (between action and draw calls) for collision detection.