Add support for 8 levels

This commit is contained in:
Juhani Krekelä 2022-01-16 14:38:47 +00:00
parent 0ca305f230
commit 531ee88980
8 changed files with 155 additions and 3 deletions

View File

@ -11,7 +11,9 @@ TILES = player_stand_tile.inc \
grass_tile.inc dirt_tile.inc flag_tile.inc \
switch1_off_tile.inc switch1_on_tile.inc \
tile1_off_tile.inc tile1_on_tile.inc \
stage1_tile.inc stage2_tile.inc star_tile.inc \
stage1_tile.inc stage2_tile.inc stage3_tile.inc stage4_tile.inc \
stage5_tile.inc stage6_tile.inc stage7_tile.inc stage8_tile.inc \
star_tile.inc \
rebind_rebind1_tile.inc rebind_rebind2_tile.inc rebind_rebind3_tile.inc \
rebind_left1_tile.inc rebind_left2_tile.inc \
rebind_right1_tile.inc rebind_right2_tile.inc \

13
stage3_tile.txt Normal file
View File

@ -0,0 +1,13 @@
xTEXT
.BG
----------
..xxxxxx..
.xx....xx.
.......xx.
.......xx.
....xxxx..
.......xx.
.......xx.
.......xx.
.xx....xx.
..xxxxxx..

13
stage4_tile.txt Normal file
View File

@ -0,0 +1,13 @@
xTEXT
.BG
----------
....xx.xx.
...xx..xx.
..xx...xx.
.xx....xx.
.xxxxxxxx.
.......xx.
.......xx.
.......xx.
.......xx.
.......xx.

13
stage5_tile.txt Normal file
View File

@ -0,0 +1,13 @@
xTEXT
.BG
----------
.xxxxxxxx.
.xx.......
.xx.......
.xx.......
.xxxxxx...
......xx..
.......xx.
.......xx.
.xx...xx..
..xxxxx...

13
stage6_tile.txt Normal file
View File

@ -0,0 +1,13 @@
xTEXT
.BG
----------
....xx....
...xx.....
..xx......
.xx.......
.xxxxxx...
.xx...xx..
.xx....xx.
.xx....xx.
..xx..xx..
...xxxx...

13
stage7_tile.txt Normal file
View File

@ -0,0 +1,13 @@
xTEXT
.BG
----------
.xxxxxxxx.
.......xx.
.......xx.
......xx..
......xx..
.....xx...
.....xx...
....xx....
....xx....
....xx....

13
stage8_tile.txt Normal file
View File

@ -0,0 +1,13 @@
xTEXT
.BG
----------
...xxxx...
..xx..xx..
.xx....xx.
..xx..xx..
...xxxx...
..xx..xx..
.xx....xx.
.xx....xx.
..xx..xx..
...xxxx...

View File

@ -13,7 +13,7 @@
#include <time.h>
#include <timespec.h>
#define STAGES 2
#define STAGES 8
enum game_mode { TITLESCREEN, STAGE };
enum game_mode game_mode = TITLESCREEN;
bool stages_beat[STAGES];
@ -54,6 +54,12 @@ static enum palette playfield[PLAYFIELD_SIDE * PLAYFIELD_SIDE];
#include "stage1_tile.inc"
#include "stage2_tile.inc"
#include "stage3_tile.inc"
#include "stage4_tile.inc"
#include "stage5_tile.inc"
#include "stage6_tile.inc"
#include "stage7_tile.inc"
#include "stage8_tile.inc"
#include "star_tile.inc"
#include "rebind_rebind1_tile.inc"
@ -88,7 +94,67 @@ static char *stages[] = {
" A "
" 11g "
"@ !"
"ggg gg"
"ggg gg",
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ",
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ",
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ",
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ",
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ",
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ",
};
enum switches_state { ALL_OFF, SWITCH1 };
@ -450,6 +516,12 @@ static void draw_titlescreen(struct timespec now) {
}
draw_tile(stage1_tile, 1 * TILE_SIDE, TILE_SIDE);
draw_tile(stage2_tile, 2 * TILE_SIDE, TILE_SIDE);
draw_tile(stage3_tile, 3 * TILE_SIDE, TILE_SIDE);
draw_tile(stage4_tile, 4 * TILE_SIDE, TILE_SIDE);
draw_tile(stage5_tile, 5 * TILE_SIDE, TILE_SIDE);
draw_tile(stage6_tile, 6 * TILE_SIDE, TILE_SIDE);
draw_tile(stage7_tile, 7 * TILE_SIDE, TILE_SIDE);
draw_tile(stage8_tile, 8 * TILE_SIDE, TILE_SIDE);
size_t underline_y = 2 * TILE_SIDE + 1;
size_t underline_x = selection_index * TILE_SIDE + TILE_SIDE + 2;
for (size_t x = 0; x < TILE_SIDE - 4; x++)