Kostadin Chakarov / Mbed 2 deprecated el17kec

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

StaticGameObject Class Reference

StaticGameObject Class Reference

StaticGameObject Class , Draws and controls the objects in the Breakout game, which are static. More...

#include <GameObject.h>

Inherited by GameObject.

Public Member Functions

 StaticGameObject ()
 Constructor.
 ~StaticGameObject ()
 Destructor.
virtual void move ()
 Controls the movement physics of static game objects: Does nothing but is overwritten in GameObject.
virtual void draw (N5110 &lcd)
 Draws the game object.
const Vector2DgetPos () const
 Gets the x and y coordinates of game object.
int getW ()
 Gets the width of the game object.
int getH ()
 Gets the height of the game object.
void setW (int value)
 Sets the width of any game object.

Protected Attributes

Vector2D pos
 width and height of any game object

Detailed Description

StaticGameObject Class , Draws and controls the objects in the Breakout game, which are static.

Author:
Kostadin Chakarov, University of Leeds
Date:
April 2019

Definition at line 14 of file GameObject.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 3 of file GameObject.cpp.

Destructor.

Definition at line 7 of file GameObject.cpp.


Member Function Documentation

void draw ( N5110 lcd ) [virtual]

Draws the game object.

Reimplemented in PowerUp.

Definition at line 20 of file GameObject.cpp.

int getH (  )

Gets the height of the game object.

Returns:
the height of the game object

Definition at line 34 of file GameObject.h.

const Vector2D & getPos (  ) const

Gets the x and y coordinates of game object.

Definition at line 11 of file GameObject.cpp.

int getW (  )

Gets the width of the game object.

Returns:
the width of the game object

Definition at line 30 of file GameObject.h.

void move (  ) [virtual]

Controls the movement physics of static game objects: Does nothing but is overwritten in GameObject.

Reimplemented in Ball, GameObject, and Paddle.

Definition at line 16 of file GameObject.cpp.

void setW ( int  value )

Sets the width of any game object.

Parameters:
value- sets the width of the game objects equal to it

Used for the power-up features

Definition at line 39 of file GameObject.h.


Field Documentation

Vector2D pos [protected]

width and height of any game object

Definition at line 42 of file GameObject.h.