Dumb-ways-to-memorize
2D game
Data Fields
entity_t Struct Reference

#include <entity.h>

+ Collaboration diagram for entity_t:

Data Fields

int mHazards
 
int mNextThink
 
int mHealth
 
int mDamage
 
int mWeight
 
int mCurrentFrame
 
int mDirection:1
 
collision_type_t mCollisionType
 
entity_state_t mEntityState
 
sprite_t ** mSprites
 
sprite_t * mAnimation
 
ai_function_t * mData
 
char * mName
 
vec2_t mAccel
 
vec2_t mVelocity
 
vec2_t mPosition
 
void(* Think )(entity_t *self)
 
void(* Touch )(entity_t *self, entity_t *other, int type)
 
void(* Draw )(entity_t *self)
 
void(* PowerUp )(struct power_s *info)
 

Detailed Description

The core structure of our our entity system.

Author
Anthony Rios
Date
2/17/2016

Definition at line 21 of file entity.h.

Field Documentation

void(* entity_t::Draw) (entity_t *self)

The function that gets called every frame to draw the entity

Definition at line 41 of file entity.h.

vec2_t entity_t::mAccel

The acceleration vector

Definition at line 36 of file entity.h.

sprite_t* entity_t::mAnimation

The current animation, the entity is running

Definition at line 33 of file entity.h.

collision_type_t entity_t::mCollisionType

Type of the collision the entity is

Definition at line 30 of file entity.h.

int entity_t::mCurrentFrame

The current frame

Definition at line 28 of file entity.h.

int entity_t::mDamage

The damage the entity should deal to other entities

Definition at line 26 of file entity.h.

ai_function_t* entity_t::mData

The data that an entity stores for its ai

Definition at line 34 of file entity.h.

int entity_t::mDirection

The direction entity is facing

Definition at line 29 of file entity.h.

entity_state_t entity_t::mEntityState

The state of the entity

Definition at line 31 of file entity.h.

int entity_t::mHazards

The hazards that the entity is immune to / deals

Definition at line 23 of file entity.h.

int entity_t::mHealth

The health of the entity, if below zero - destroy this entity

Definition at line 25 of file entity.h.

char* entity_t::mName

The name of the entity

Definition at line 35 of file entity.h.

int entity_t::mNextThink

The next time the entity should think

Definition at line 24 of file entity.h.

vec2_t entity_t::mPosition

The position vector, equal to on screen draw position

Definition at line 38 of file entity.h.

sprite_t** entity_t::mSprites

The sprites of the given entity

Definition at line 32 of file entity.h.

vec2_t entity_t::mVelocity

The velocity vector

Definition at line 37 of file entity.h.

int entity_t::mWeight

The weight boolean of the entity, if gravity affects him

Definition at line 27 of file entity.h.

void(* entity_t::PowerUp) (struct power_s *info)

The player specific function for power_up useage

Definition at line 42 of file entity.h.

void(* entity_t::Think) (entity_t *self)

The think function which gets called to update the entity

Definition at line 39 of file entity.h.

void(* entity_t::Touch) (entity_t *self, entity_t *other, int type)

The function that gets called when enitities collide

Definition at line 40 of file entity.h.


The documentation for this struct was generated from the following file: