render: use tileset atlas for all entity and tile rendering; anims

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idb42cff72368e26d8d44db79ba9c413a6a6a6964
This commit is contained in:
raf 2026-04-28 15:32:56 +03:00
commit 5b640dcefd
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
7 changed files with 556 additions and 90 deletions

View file

@ -3,6 +3,7 @@
#include "common.h"
#include "items.h"
#include "settings.h"
#include "tileset/tileset.h"
#include <string.h>
void player_init(Player *p, int x, int y) {
@ -28,6 +29,13 @@ void player_init(Player *p, int x, int y) {
p->effect_count = 0;
memset(p->effects, 0, sizeof(p->effects));
// Initialize animation state
p->anim_state = PLAYER_ANIM_IDLE;
p->anim_frame = 0;
p->anim_timer = 0;
p->facing_right = 1;
p->sprite_tile_id = SPRITE_PLAYER;
// Initialize inventory to empty
for (int i = 0; i < MAX_INVENTORY; i++) {
p->inventory[i].picked_up = 1; // mark as invalid