Some more progress

This commit is contained in:
2025-05-30 22:31:59 +02:00
parent d01bdbe819
commit 0c9698879b
13 changed files with 290 additions and 72 deletions

View File

@@ -6,6 +6,7 @@
#define FACTORYGAME_PLAYER_H
#include "../tiles/tile.h"
#include "../items/item.h"
extern int playerReach;
extern int playerX;
@@ -22,6 +23,10 @@ bool isInboundsTile(int x, int y);
void adjustRect(SDL_Rect *rect);
#define neededHealthIdle 120
#define playerMaxHealth 255
typedef struct {
uint16_t slotCounts[ITEMREGISTRY_SIZE];
uint16_t activeSlotIndex;
@@ -47,12 +52,19 @@ typedef struct {
PlayerCursor cursor;
PlayerInventory inventory;
SDL_Renderer *renderer;
uint8_t health;
uint8_t prevHealth;
uint8_t healthIdle;
} Player;
void setActivePlayerSlot(Player * plr, uint16_t activeSlotIndex);
void moveActivePlayerSlot(Player *plr, bool up, bool seek);
void renderPlayer(Player * plr);
void initPlayer(Player * plr);
void updatePlayer(Player *plr);
#endif //FACTORYGAME_PLAYER_H