diff --git a/CMakeLists.txt b/CMakeLists.txt index 608be1d..d35076f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ set(ASSETS res/shake.kble res/tilt.kble res/cave.kble + res/headtrauma.kble res/fonts/dina.png ) diff --git a/inc/tile.h b/inc/tile.h index 5f52320..120965c 100644 --- a/inc/tile.h +++ b/inc/tile.h @@ -14,6 +14,8 @@ enum Tile { TILE_GRAV_R, TILE_GRAV_L, TILE_WATER, + TILE_BURN_RED, + TILE_BURN_BLUE, TILE_COUNT, TILE_OOB, }; diff --git a/res/headtrauma.kble b/res/headtrauma.kble new file mode 100644 index 0000000..31bfa34 Binary files /dev/null and b/res/headtrauma.kble differ diff --git a/res/tileset.png b/res/tileset.png index 405f7b7..a6a560a 100644 Binary files a/res/tileset.png and b/res/tileset.png differ diff --git a/src/level.c b/src/level.c index f860af8..cd08540 100644 --- a/src/level.c +++ b/src/level.c @@ -12,10 +12,11 @@ static struct Level level; extern bopti_image_t bimg_tileset; extern struct LevelBin kble_test, kble_burn, kble_bounce, kble_worm, kble_shake, - kble_tilt, kble_cave; + kble_tilt, kble_cave, kble_headtrauma; static const struct LevelBinNamed levels[] = { {&kble_test, "gentle introduction"}, - {&kble_cave, "light at the end of the tunnel"}, + {&kble_cave, "the light at the end of the tunnel"}, + {&kble_headtrauma, "minefield"}, {&kble_burn, "these are rare"}, {&kble_bounce, "deceptive road"}, {&kble_shake, "breaking into reality"}, @@ -92,9 +93,11 @@ level_regen_visual_data(int editing) if (editing) continue; switch (tile) { case TILE_RED: + case TILE_BURN_RED: vd->img_y += polarity() ? TILE_SIZE : 0; break; case TILE_BLUE: + case TILE_BURN_BLUE: vd->img_y += polarity() ? 0 : TILE_SIZE; break; default: diff --git a/src/player.c b/src/player.c index 2f90d24..eacfd76 100644 --- a/src/player.c +++ b/src/player.c @@ -12,6 +12,7 @@ static struct Vec update_rem(struct Player *); static int collide_margin(int x, int y, int tile, int margin); static int collide(int x, int y, int tile); static int collide_solid(int x, int y); +static int collide_burn(int x, int y); void player_spawn(struct Player *p) @@ -116,7 +117,7 @@ player_update(struct Player *p) } /* burn and death */ - if (collide(p->pos.x, p->pos.y, TILE_BURN)) { + if (collide_burn(p->pos.x, p->pos.y)) { if (++p->burn >= BURN_DEATH) { level_reload(); return; @@ -241,3 +242,11 @@ collide_solid(int x, int y) (!polarity() && collide(x, y, TILE_RED)) || (polarity() && collide(x, y, TILE_BLUE)); } + +static int +collide_burn(int x, int y) +{ + return collide(x, y, TILE_BURN) || + (!polarity() && collide(x, y, TILE_BURN_RED)) || + (polarity() && collide(x, y, TILE_BURN_BLUE)); +}