SDL Breakout Engine  0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
Public Member Functions | List of all members
Brick Class Reference

#include <GameObject.hpp>

Inheritance diagram for Brick:
GUIElement GameObject

Public Member Functions

 Brick (const std::shared_ptr< TextureWrapper > &texture, const std::string &tag)
 
void Hit (const std::string &tag)
 
- Public Member Functions inherited from GUIElement
 GUIElement (const std::shared_ptr< TextureWrapper > &texture)
 
 GUIElement (const std::shared_ptr< TextureWrapper > &texture, const std::string &tag)
 
 GUIElement (const std::shared_ptr< TextureWrapper > &texture, const Vector3D &startPosition)
 
 GUIElement (const std::shared_ptr< TextureWrapper > &texture, const Vector3D &startPosition, const std::string &tag)
 
void Render (SDL_Renderer *renderer)
 
 GUIElement ()
 blank GUIElement More...
 
- Public Member Functions inherited from GameObject
 GameObject (const std::string &tag)
 
 GameObject (const Vector3D &position)
 
 GameObject (const Vector3D &position, const std::string &tag)
 
 GameObject (const Vector3D &position, const Vector3D &size)
 
 GameObject (const Vector3D &position, const Vector3D &size, const std::string &tag)
 
void Update (const Vector3D &position)
 
Vector3D GetSize ()
 
Vector3D GetSize () const
 
const Vector3D_GetPosition () const
 
void DebugRender (SDL_Renderer *renderer)
 
 GameObject ()
 default constructor for a gameobject More...
 

Additional Inherited Members

- Public Attributes inherited from GameObject
std::string mTag = ""
 the name of this object, should be unique to other objects unless grouping is desired. More...
 
bool alive = true
 whether this object is alive or not. More...
 
- Protected Attributes inherited from GUIElement
std::shared_ptr< TextureWrappermTexture
 internal texture More...
 
SDL_Rect mDestination
 rectangle representing the bounding box More...
 
- Protected Attributes inherited from GameObject
int mWidth = 0
 internal width More...
 
int mHeight = 0
 internal height More...
 
Vector3D mPosition = Vector3D(0, 0, 0)
 internal position More...
 
Vector3D startPosition
 start position More...
 

Detailed Description

Simple GUIELement that handles collision with a 'ball' GameObject.

Constructor & Destructor Documentation

Brick::Brick ( const std::shared_ptr< TextureWrapper > &  texture,
const std::string &  tag 
)

Create a brick with a desired texture and name.

Parameters
texturehow the brick looks
tagthe name of the brick element

Member Function Documentation

void Brick::Hit ( const std::string &  tag)
virtual

Defines functionality for when this brick gets hit.

Parameters
tagwhat hit it.

Reimplemented from GameObject.


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