draw lev-- SHIT ICE CREAM TRUCK
This commit is contained in:
parent
692beeca17
commit
1c161f621f
|
@ -3,3 +3,4 @@
|
|||
void level_deinit(void);
|
||||
void level_load(int id);
|
||||
void level_find(int tile, int *x, int *y);
|
||||
void level_draw(void);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
tset.png:
|
||||
type: bopti-image
|
||||
name: bimg_tset
|
||||
profile: p4
|
||||
font.png:
|
||||
type: bopti-image
|
||||
name: bimg_font
|
||||
|
|
13
src/level.c
13
src/level.c
|
@ -41,8 +41,19 @@ void level_find(int tile, int *x, int *y)
|
|||
if (x != NULL)
|
||||
*x = i % width * TILE_SIZE;
|
||||
if (y != NULL)
|
||||
*y = i % height * TILE_SIZE;
|
||||
*y = i / width * TILE_SIZE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void level_draw(void)
|
||||
{
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
const int t = data[x + y * width];
|
||||
if (t && t != 2)
|
||||
LZY_DrawTile(t, x * TILE_SIZE, y * TILE_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
level_load(0);
|
||||
player_init(0, 0);
|
||||
|
||||
while (!LZY_ShouldQuit()) {
|
||||
LZY_CycleEvents();
|
||||
|
@ -29,6 +28,7 @@ int main(int argc, char **argv)
|
|||
LZY_DrawTileEx(TSET_LINE, 0, DISPLAY_HEIGHT / 2, 13, 7);
|
||||
LZY_DrawTileEx(TSET_LINE, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2,
|
||||
13, 7);
|
||||
level_draw();
|
||||
player_draw();
|
||||
LZY_DrawEnd();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue