mirror of https://git.sr.ht/~kikoodx/crystal-tower
pointless (lol) spikes
This commit is contained in:
parent
bf1820bee2
commit
606fc1e8fb
|
@ -31,6 +31,7 @@ set(LEVELS
|
|||
lvl/3.kble
|
||||
lvl/4.kble
|
||||
lvl/5.kble
|
||||
lvl/6.kble
|
||||
)
|
||||
|
||||
set(ASSETS
|
||||
|
|
|
@ -6,5 +6,9 @@ enum Tile {
|
|||
TILE_PLAYER,
|
||||
TILE_SHATTERED,
|
||||
TILE_OOB,
|
||||
TILE_SPIKE_U,
|
||||
TILE_SPIKE_D,
|
||||
TILE_SPIKE_R,
|
||||
TILE_SPIKE_L,
|
||||
TILE_NEXT,
|
||||
};
|
||||
|
|
Binary file not shown.
BIN
res/tileset.png
BIN
res/tileset.png
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 14 KiB |
|
@ -9,9 +9,9 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
static struct Level self;
|
||||
extern struct LevelBin lvl_0, lvl_1, lvl_2, lvl_3, lvl_4, lvl_5;
|
||||
extern struct LevelBin lvl_0, lvl_1, lvl_2, lvl_3, lvl_4, lvl_5, lvl_6;
|
||||
static const struct LevelBin *levels[] = {&lvl_0, &lvl_1, &lvl_2, &lvl_3,
|
||||
&lvl_4, &lvl_5, NULL};
|
||||
&lvl_4, &lvl_5, &lvl_6, NULL};
|
||||
|
||||
void
|
||||
level_load(int id)
|
||||
|
|
|
@ -24,5 +24,15 @@ shatter(int x, int y)
|
|||
static void
|
||||
callback(struct Anim *a)
|
||||
{
|
||||
level_set_px(a->pos.x, a->pos.y, TILE_SHATTERED);
|
||||
const int x = a->pos.x / TILE_SIZE;
|
||||
const int y = a->pos.y / TILE_SIZE;
|
||||
level_set(x, y, TILE_SHATTERED);
|
||||
if (level_get(x - 1, y) == TILE_SPIKE_L)
|
||||
level_set(x - 1, y, TILE_VOID);
|
||||
if (level_get(x + 1, y) == TILE_SPIKE_R)
|
||||
level_set(x + 1, y, TILE_VOID);
|
||||
if (level_get(x, y - 1) == TILE_SPIKE_U)
|
||||
level_set(x, y - 1, TILE_VOID);
|
||||
if (level_get(x, y + 1) == TILE_SPIKE_D)
|
||||
level_set(x, y + 1, TILE_VOID);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue