2023-01-24 12:45:52 +01:00
|
|
|
#include "color32.h"
|
2023-01-20 10:01:15 +01:00
|
|
|
#include "gamepad.h"
|
2023-01-22 19:02:48 +01:00
|
|
|
#include "gsa_map.h"
|
2023-01-22 18:47:53 +01:00
|
|
|
#include "gsa_text.h"
|
2022-12-31 12:14:57 +01:00
|
|
|
#include <gsa.h>
|
|
|
|
|
2023-01-24 12:45:52 +01:00
|
|
|
sw_color32 pal[GSA_PALETTE_SIZE];
|
|
|
|
|
|
|
|
void fade_palette(f32 amount) {
|
|
|
|
i32 i;
|
|
|
|
|
|
|
|
for(i = 0; i < GSA_PALETTE_SIZE; ++i) {
|
|
|
|
palette[i] = sw_color32_mix(SW_COLOR32_BLACK, pal[i], amount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool tick_fade_in();
|
2023-01-22 18:47:53 +01:00
|
|
|
|
2023-01-24 12:45:52 +01:00
|
|
|
void init() {
|
2023-01-20 09:30:34 +01:00
|
|
|
i32 x, y;
|
2022-12-31 12:14:57 +01:00
|
|
|
|
2023-01-24 12:45:52 +01:00
|
|
|
gsa_copy_palette_to(pal);
|
|
|
|
|
2023-01-20 09:30:34 +01:00
|
|
|
for(y = 0; y < 11; ++y) {
|
|
|
|
for(x = 0; x < 19; ++x) {
|
|
|
|
maps[0].tiles[x][y] = 0x1000;
|
|
|
|
}
|
|
|
|
}
|
2023-01-07 14:22:22 +01:00
|
|
|
|
2023-01-20 09:30:34 +01:00
|
|
|
for(y = 0; y < 11; y += 2) {
|
|
|
|
maps[0].tiles[0][y] = 0x1101;
|
|
|
|
maps[0].tiles[1][y] = 0x1102;
|
|
|
|
maps[0].tiles[0][y + 1] = 0x1201;
|
|
|
|
maps[0].tiles[1][y + 1] = 0x1202;
|
|
|
|
|
|
|
|
maps[0].tiles[17][y] = 0x1101;
|
|
|
|
maps[0].tiles[18][y] = 0x1102;
|
|
|
|
maps[0].tiles[17][y + 1] = 0x1201;
|
|
|
|
maps[0].tiles[18][y + 1] = 0x1202;
|
|
|
|
}
|
2023-01-22 18:47:53 +01:00
|
|
|
|
|
|
|
maps[1].half_tile = true;
|
|
|
|
font = 0x1010;
|
|
|
|
gsa_write_text(1, 7, 3, "Game Skunk Advance!!! <3");
|
2023-01-24 12:45:52 +01:00
|
|
|
gsa_run_loop(tick_fade_in);
|
2022-12-31 12:14:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void tick() {
|
2023-01-22 12:34:32 +01:00
|
|
|
maps[0].scrollx -= input.x_dir;
|
|
|
|
maps[0].scrolly -= input.y_dir;
|
2022-12-31 12:14:57 +01:00
|
|
|
}
|
2023-01-24 12:45:52 +01:00
|
|
|
|
|
|
|
bool tick_fade_in() {
|
|
|
|
static i32 t = 0;
|
|
|
|
|
|
|
|
fade_palette(t / 60.f);
|
|
|
|
++t;
|
|
|
|
return t <= 60;
|
|
|
|
}
|