Andreas Garmannslund / Mbed 2 deprecated SimplePlatformGame

Dependencies:   N5110 PinDetect PowerControl mbed

Embed: (wiki syntax)

« Back to documentation index

Enemy Class Reference

Enemy class. More...

#include <Enemy.h>

Inherits Entity.

Public Types

enum  Type
 

Different type of enemies.

More...

Public Member Functions

int getRight ()
 Returns x-position of the right edge.
int getBottom ()
 Returns y-position of the bottom edge.

Data Fields

Type type
 What type of enemy it is.
int difficulty
 Multiplier used for giving more points.
int jumpRate
 Probability (in percent) of trying to jump if at ground.
int x
 Position of entity (origin: left upper corner)
int vx
 Velocity of entity.
int width
 Width of entity.
int height
 Height of entity.
bool facingLeft
 True if the entity is facing left.
bool onGround
 True if entity is standing on the ground.
bool dead
 True if enemy is dead.

Detailed Description

Enemy class.

Definition at line 9 of file Enemy.h.


Member Enumeration Documentation

enum Type

Different type of enemies.

Definition at line 13 of file Enemy.h.


Member Function Documentation

int getBottom (  ) [inherited]

Returns y-position of the bottom edge.

Definition at line 40 of file Entity.h.

int getRight (  ) [inherited]

Returns x-position of the right edge.

Definition at line 37 of file Entity.h.


Field Documentation

bool dead [inherited]

True if enemy is dead.

Definition at line 34 of file Entity.h.

Multiplier used for giving more points.

Definition at line 22 of file Enemy.h.

bool facingLeft [inherited]

True if the entity is facing left.

Definition at line 29 of file Entity.h.

int height [inherited]

Height of entity.

Definition at line 26 of file Entity.h.

int jumpRate

Probability (in percent) of trying to jump if at ground.

Definition at line 25 of file Enemy.h.

bool onGround [inherited]

True if entity is standing on the ground.

Definition at line 31 of file Entity.h.

What type of enemy it is.

Definition at line 19 of file Enemy.h.

int vx [inherited]

Velocity of entity.

Definition at line 20 of file Entity.h.

int width [inherited]

Width of entity.

Definition at line 23 of file Entity.h.

int x [inherited]

Position of entity (origin: left upper corner)

Definition at line 17 of file Entity.h.