Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Enumerations Pages
Public Member Functions | Protected Attributes | Friends | List of all members
CGameObject Class Reference

The game object. More...

#include <Object.h>

Inheritance diagram for CGameObject:
CBallObject

Public Member Functions

 CGameObject (GameObjectType objecttype)
 Constructor.
 
virtual void move ()
 Move yourself, raus raus raus!
 

Protected Attributes

GameObjectType m_nObjectType
 Object type.
 
D3DXVECTOR2 m_vPosition
 Current position.
 
D3DXVECTOR2 m_vVelocity
 Current velocity.
 
int m_nLastMoveTime
 Last time moved.
 
BOOL m_bAtRest
 Whether object is at rest.
 
int m_nFrictionTime
 Timer for applying friction.
 

Friends

class CObjectManager
 
class CBallManager
 
class CObjectWorld
 
class CRenderWorld
 

Detailed Description

The game object.

Game objects are responsible for remembering information about themselves, in particular, their representations in Render World and Physics World.

Constructor & Destructor Documentation

CGameObject::CGameObject ( GameObjectType  objecttype)

Constructor.

Constructor for a game object.

Parameters
objecttypeObject type.

Member Function Documentation

void CGameObject::move ( )
virtual

Move yourself, raus raus raus!

Move in proportion to velocity vector and time since last move, and apply a small amount of friction to reduce the velocity.

Reimplemented in CBallObject.