level 'burn' & burn fix

This commit is contained in:
KikooDX 2021-12-17 23:26:39 +01:00
parent c0d48156fe
commit 05ac1bba00
4 changed files with 5 additions and 3 deletions

View File

@ -21,6 +21,7 @@ set(SOURCES
set(ASSETS
res/tileset.png
res/test.kble
res/burn.kble
)
set(FLAGS -std=c99 -Os -Wall -Wextra -Wshadow)

BIN
res/burn.kble Normal file

Binary file not shown.

View File

@ -10,8 +10,8 @@
static struct Level level;
extern bopti_image_t bimg_tileset;
extern struct LevelBin kble_test;
static const struct LevelBin *levels[] = {&kble_test, NULL};
extern struct LevelBin kble_test, kble_burn;
static const struct LevelBin *levels[] = {&kble_test, &kble_burn, NULL};
static void level_free(void);

View File

@ -22,6 +22,7 @@ player_spawn(struct Player *p)
p->air_state = AS_NEUTRAL;
p->jump_buffer = 0;
p->jump_grace = 0;
p->burn = 0;
}
void
@ -81,7 +82,7 @@ player_update(struct Player *p)
/* burn and death */
if (collide(p->pos.x, p->pos.y, TILE_BURN)) {
if (++p->burn >= BURN_DEATH) level_reload();
} else {
} else if (p->burn) {
p->burn--;
}