Files
ld58/code/game/player.h

46 lines
905 B
C

#if !defined(LD_GAME_PLAYER_H_)
#define LD_GAME_PLAYER_H_
#include "../core/types.h"
#include "../core/macros.h"
#include <SDL3/SDL_events.h>
#include "aabb.h"
#define PLAYER_SPEED 10.0f
#define PLAYER_RELOAD_TIME 1.5f
#define PLAYER_BULLET_COUNT 6
typedef struct ControlState ControlState;
struct ControlState {
bool rightDown;
bool leftDown;
bool upDown;
bool downDown;
bool shot;
};
typedef struct Player Player;
struct Player
{
World *world;
AABB collision;
World_Area currentArea;
U32 bulletsLoaded;
ControlState controls;
V2f shotPos;
G_Outfit outfit;
U32 health;
F32 reloadTimer;
};
function void PlayerInit(G_State *game, Player *player);
function void PlayerDraw(D_Context *draw, Player *player);
function void PlayerInput(SDL_Event *event, Player *player);
function void PlayerUpdate(F32 delta, Player *player);
#endif // LD_GAME_PLAYER_H_