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:
parent
2f5c959500
commit
5b640dcefd
7 changed files with 556 additions and 90 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue