level 'burn' & burn fix
This commit is contained in:
parent
c0d48156fe
commit
05ac1bba00
|
@ -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)
|
||||
|
|
Binary file not shown.
|
@ -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);
|
||||
|
||||
|
|
|
@ -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--;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue