Breakout
Breakout
Public Member Functions | Protected Attributes | List of all members
GameObject Class Referenceabstract

A GameObject class. More...

#include <GameObject.hpp>

Inheritance diagram for GameObject:
Inheritance graph
Collaboration diagram for GameObject:
Collaboration graph

Public Member Functions

 GameObject (int posX, int posY, int width, int height)
 Constructs a GameObject. More...
 
virtual void Update ()=0
 Updates this GameObject.
 
virtual void Render (SDL_Renderer *ren)=0
 Renders this GameObject.
 
int getPosX () const
 Gets the x position of this GameObject. More...
 
int getPosY () const
 Gets the y position of this GameObject. More...
 
int getScaleW () const
 Gets the total width of this GameObject. More...
 
int getScaleH () const
 Gets the total height of this GameObject. More...
 
void Disable ()
 Disables this GameObject.
 
void Enable ()
 Enables this GameObject.
 
bool IsActive () const
 Gets whether this GameObject is active. More...
 

Protected Attributes

int x
 The x coordinate of the center of this GameObject.
 
int y
 The x coordinate of the center of this GameObject.
 
int scaleW
 The total width of this GameObject.
 
int scaleH
 The total height of this GameObject.
 
bool active
 Whether or not this GameObject is active.
 

Detailed Description

A GameObject class.

This represents a simple object within our game, having a position, dimensions, and an active state.

Constructor & Destructor Documentation

◆ GameObject()

GameObject::GameObject ( int  posX,
int  posY,
int  width,
int  height 
)

Constructs a GameObject.

Parameters
posXThe x coordinate of this GameObject
posYThe y coordinate of this GameObject
widthThe width of this GameObject
heightThe height of this GameObject

Member Function Documentation

◆ getPosX()

int GameObject::getPosX ( ) const

Gets the x position of this GameObject.

Returns
The x position
Here is the caller graph for this function:

◆ getPosY()

int GameObject::getPosY ( ) const

Gets the y position of this GameObject.

Returns
The y position

◆ getScaleH()

int GameObject::getScaleH ( ) const

Gets the total height of this GameObject.

Returns
The height

◆ getScaleW()

int GameObject::getScaleW ( ) const

Gets the total width of this GameObject.

Returns
The width

◆ IsActive()

bool GameObject::IsActive ( ) const

Gets whether this GameObject is active.

Returns
The GameObject's active state

The documentation for this class was generated from the following files: