GEJM  1.0.0.0
a 2D platformer made by students
Public Member Functions | List of all members
MonsterCreature Class Reference

#include <MonsterCreature.h>

Inheritance diagram for MonsterCreature:
Creature SolidObject Object

Public Member Functions

 MonsterCreature (double x=0.0, double y=0.0, double width=1.0, double height=1.0, Uint8 health=1)
 
 ~MonsterCreature ()
 
void onCollision (SolidObject *collider) override
 
MonsterCreatureoperator= (MonsterCreature const &)=delete
 
- Public Member Functions inherited from Creature
 Creature (double x=0.0, double y=0.0, double width=1.0, double height=1.0, Uint8 health=1)
 
virtual ~Creature ()
 
void savePrevious () override
 
void moveBy (double x, double y)
 
void hurt (Sint8 damage)
 
void setSpeedVector (double x, double y)
 
void addCollisionState (CollisionState state)
 
Uint8 getHealth () const
 
bool getIsAlive () const
 
bool getIsInvulnerable () const
 
bool getWasInvulnerable () const
 
double getSpeedX () const
 
double getSpeedY () const
 
CollisionState getCollisionState () const
 
Creatureoperator= (Creature const &)=delete
 
- Public Member Functions inherited from SolidObject
 SolidObject (double x=0.0, double y=0.0, double width=1.0, double height=1.0)
 
virtual ~SolidObject ()
 
- Public Member Functions inherited from Object
 Object (double x=0.0, double y=0.0, double width=1.0, double height=1.0)
 
virtual ~Object ()
 
void destroy ()
 
double getY () const
 
double getX () const
 
double getWidth () const
 
double getHeight () const
 
double getPrevX () const
 
double getPrevY () const
 
bool getDestroyed () const
 

Additional Inherited Members

- Protected Attributes inherited from Creature
Uint8 health
 
Uint32 const invFrames
 
bool isAlive
 
bool isInvulnerable
 
bool wasInvulnerable
 
double speedX
 
double speedY
 
CollisionState collisionState
 
Timer invTimer
 
- Protected Attributes inherited from Object
double x
 
double y
 
double width
 
double height
 
double prevX
 
double prevY
 
bool destroyed
 

Detailed Description

MonsterCreature is a Creature that should be AI controlled as it hurts PlayerCreature. It derives from Creature.

See also
Creature

Constructor & Destructor Documentation

MonsterCreature::MonsterCreature ( double  x = 0.0,
double  y = 0.0,
double  width = 1.0,
double  height = 1.0,
Uint8  health = 1 
)

The default constructor of MonsterCreature.

Parameters
xX position of MonsterCreature. Defaults to 0.0
yY position of MonsterCreature. Defaults to 0.0
widthwidth of MonsterCreature. Defaults to 1.0
heightheight of MonsterCreature. Defaults to 1.0
healthhealth of MonsterCreature. Defaults to 1
See also
Creature

MonsterCreature implementation The default constructor of MonsterCreature.

Parameters
xX position of MonsterCreature. Defaults to 0.0
yY position of MonsterCreature. Defaults to 0.0
widthwidth of MonsterCreature. Defaults to 1.0
heightheight of MonsterCreature. Defaults to 1.0
healthhealth of MonsterCreature. Defaults to 1
See also
Creature
MonsterCreature::~MonsterCreature ( )

Default destructor

Member Function Documentation

void MonsterCreature::onCollision ( SolidObject collider)
overridevirtual

Function for resolving special cases of collision. If special case is not found, function calls Creature implementation of onCollision.

Parameters
collidera pointer to a SolidObject with which MonsterCreature is colliding
Returns
void

Reimplemented from Creature.

MonsterCreature& MonsterCreature::operator= ( MonsterCreature const &  )
delete

Assignment operator is deleted because of constant member initialized on Construction.


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