Add splash screen functionality and update game state management
- Introduced GAME_SPLASH_SCREEN state in game.h - Implemented splash_screen_init and splash_screen_update functions in splash_screen.c - Updated game.c to initialize with GAME_SPLASH_SCREEN and handle splash screen updates - Removed old splash screen code from main.c
This commit is contained in:
@@ -18,10 +18,6 @@
|
||||
#include "soundbank.h"
|
||||
#include "soundbank_bin.h"
|
||||
|
||||
#define SPLASH_FPS 60
|
||||
#define SPLASH_DURATION_SECONDS 10
|
||||
#define SPLASH_DURATION_FRAMES (SPLASH_FPS * SPLASH_DURATION_SECONDS)
|
||||
|
||||
void init()
|
||||
{
|
||||
irq_init(NULL);
|
||||
@@ -71,23 +67,6 @@ void init()
|
||||
|
||||
REG_DISPCNT = DCNT_MODE1 | DCNT_OBJ_1D | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_OBJ | DCNT_WIN0 | DCNT_WIN1;
|
||||
|
||||
// Splash screen
|
||||
tte_printf("#{P:72,8; cx:0xF000}DISCLAIMER");
|
||||
tte_printf("#{P:8,24; cx:0xF000}This project is NOT endorsed \n by or affiliated with \n Playstack or LocalThunk.\n\n If you have paid for this, \n you have been scammed \n and should request a refund \n IMMEDIATELY. \n\n The only official place \n to obtain this is from: \n\n 'github.com/\n cellos51/balatro-gba'");
|
||||
tte_printf("#{P:8,144; cx:0xF000}(Press any key to skip)");
|
||||
for (int i = 0; i < SPLASH_DURATION_FRAMES; i++)
|
||||
{
|
||||
VBlankIntrWait();
|
||||
key_poll();
|
||||
if (key_hit(KEY_A | KEY_B | KEY_START | KEY_SELECT)) // Skip intro
|
||||
{
|
||||
break;
|
||||
}
|
||||
tte_erase_rect_wrapper((Rect){208, 144, 240, 152});
|
||||
tte_printf("#{P:208,144; cx:0xF000}%d", 1 + (SPLASH_DURATION_FRAMES - i) / SPLASH_FPS);
|
||||
}
|
||||
tte_erase_screen();
|
||||
|
||||
// Initialize subsystems
|
||||
mmInitDefault((mm_addr)soundbank_bin, 12);
|
||||
mmStart(MOD_MAIN_THEME, MM_PLAY_LOOP);
|
||||
|
||||
Reference in New Issue
Block a user