feat: created Enemy struct
This commit is contained in:
parent
71d8ebd45c
commit
39999eaabd
8
game/src/Enemy.c
Normal file
8
game/src/Enemy.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include "Enemy.h"
|
||||
#include "debug.h"
|
||||
|
||||
Enemy* MakeEnemy() {
|
||||
Enemy* self = malloc(sizeof(Enemy));
|
||||
ASSERT_RETURN
|
||||
return self;
|
||||
}
|
25
game/src/Enemy.h
Normal file
25
game/src/Enemy.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef FIGHT_ENEMY_H
|
||||
#define FIGHT_ENEMY_H
|
||||
|
||||
#include "transform.h"
|
||||
#include "state_machine.h"
|
||||
#include "rigidbody.h"
|
||||
#include "collider.h"
|
||||
|
||||
typedef struct Enemy {
|
||||
Transform transform;
|
||||
|
||||
StateMachine behaviour;
|
||||
|
||||
RigidBody* rigidbody;
|
||||
Collider* collider;
|
||||
} Enemy;
|
||||
|
||||
extern Enemy* MakeEnemy();
|
||||
extern Enemy* SpawnEnemy(Vector location, const State* entryState);
|
||||
|
||||
extern void EnemyStart(Enemy* self);
|
||||
extern void EnemyUpdate(Enemy* self, float deltaTime);
|
||||
extern void EnemyDestroy(Enemy* self);
|
||||
|
||||
#endif // !FIGHT_ENEMY_H
|
Loading…
Reference in a new issue