Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Bouncy Class Reference
[Example Code]

Slightly modified Sprite. More...

#include <bouncy.h>

Inheritance diagram for Bouncy:

Inheritance graph
[legend]
Collaboration diagram for Bouncy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void OnCollide (const Sprite *spr, ColType index)
 Overloaded collision operator, handles elastic collisions.

 Bouncy ()
 Default constructor. Sets random position and direction.

virtual void Update (Sint32 dtick)
 Overloaded movement handler. Bounces off edges of screen!


Protected Member Functions

Sfxp XMin () const
 Returns minimum X position value.

Sfxp YMin () const
 Returns minimum Y position value.

Sfxp XMax () const
 Returne maximum X position value.

Sfxp YMax () const
 Returns maximum Y position value.

void AdvanceFrame ()
 Does kinda what you think.


Detailed Description

Some simple example code. The constructor is overloaded to set the SPRITE_DELETEABLE flag, which guarantees that the sprite will be destroyed by SpriteManager when it's destroyed. OnCollide() is overloaded to cause the sprites to bounce off each other on collision. Update() is overloaded to prevent the sprite from going offscreen.

Definition at line 118 of file bouncy.h.


The documentation for this class was generated from the following file:
Generated on Sat Oct 11 13:19:34 2003 for Spritelib by doxygen 1.3.4