From 3b3cd7e421fa14f9803199b22dcdcc6c59761475 Mon Sep 17 00:00:00 2001 From: Leander Scherer Date: Wed, 11 Mar 2026 23:17:01 +0100 Subject: feat(player): add health, inventory, and pickup collection --- include/player.h | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/player.h b/include/player.h index f77de50..99a3ce9 100644 --- a/include/player.h +++ b/include/player.h @@ -1,24 +1,33 @@ -#ifndef PLAYER_H -#define PLAYER_H +#pragma once -#include "map_manager.h" #include "raylib.h" +#include "raytmx.h" -typedef struct Player { +#include "map.h" + +typedef enum { PLAYER_IDLE, PLAYER_WALK, PLAYER_ATTACK } PlayerState; + +typedef struct { + int potions; + int bombs; + int currency; +} Inventory; + +typedef struct { Vector2 position; float speed; Rectangle bounds; - - // Animation state + TmxTileset tileset; int currentFrame; float frameTime; - int state; // 0: idle, 1: walk, etc. + PlayerState state; bool facingRight; + int health; + int maxHealth; + Inventory inventory; } Player; -void UpdatePlayer(Player *p, MapManager *mapMgr); -void DrawPlayer(Player *p); - -#endif +void UpdatePlayer(Player *player, Map *map, struct Entities *entities); +void DrawPlayer(Player *player); -- cgit v1.3.1