diff --git a/bible.txt b/bible.txt index 18c8203..d8fd7fa 100644 --- a/bible.txt +++ b/bible.txt @@ -1,3 +1,6 @@ +CRYTPIC CAVES? + + ######### # THEME # ######### diff --git a/res/font.png b/res/font.png index 294553c..b9f7c7c 100644 Binary files a/res/font.png and b/res/font.png differ diff --git a/res/resources.res b/res/resources.res index dd5dd7b..27788af 100644 --- a/res/resources.res +++ b/res/resources.res @@ -1,4 +1,8 @@ IMAGE font "font.png" BEST NONE + +IMAGE startBg1 "start/bg1.png" FAST +IMAGE startLogo1 "start/logo1.png" FAST + IMAGE frame "chrome/frame.png" FAST IMAGE wall1 "bg/wall1.png" FAST diff --git a/res/start/bg1.png b/res/start/bg1.png new file mode 100644 index 0000000..974f2b9 Binary files /dev/null and b/res/start/bg1.png differ diff --git a/res/start/logo1.png b/res/start/logo1.png new file mode 100644 index 0000000..62828e4 Binary files /dev/null and b/res/start/logo1.png differ diff --git a/src/background.h b/src/background.h index 5733775..a0cf3bd 100644 --- a/src/background.h +++ b/src/background.h @@ -10,9 +10,8 @@ static void drawBg(){ for(u16 x = 0; x < BG_W; x++) for(u16 y = 0; y < BG_H; y++){ - if(x % 8 == 0 && y % 8 == 0){ + if(x % 8 == 0 && y % 8 == 0) VDP_drawImageEx(BG_A, &wall1, TILE_ATTR_FULL(PAL2, 0, 0, 0, BG_I), x, y, 0, DMA); - } } } diff --git a/src/global.h b/src/global.h index 0071073..65e4cd7 100644 --- a/src/global.h +++ b/src/global.h @@ -16,7 +16,8 @@ #define COUNT_INT 8 #define INVINCIBLE_LIMIT 60 * 4 -bool killBullets; +bool killBullets, + started; s16 clock; @@ -26,4 +27,6 @@ u32 score, s16 emptyI; // lmao void EMPTY(s16 i){emptyI = i;} +void loadGame(); + void collideObstacleWithPlayer(s16); diff --git a/src/main.c b/src/main.c index cc1e75d..fb3a078 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include "global.h" #include "structs.h" #include "controls.h" +#include "start.h" #include "background.h" #include "foreground.h" #include "bullets.h" @@ -18,7 +19,6 @@ static void loadInternals(){ JOY_init(); JOY_setEventHandler(&updateControls); SPR_init(127, 0, 0); - VDP_setScreenWidth256(); VDP_setPalette(PAL1, nitori.palette -> data); VDP_setPalette(PAL2, wall1.palette -> data); VDP_setPalette(PAL3, font.palette -> data); @@ -26,7 +26,8 @@ static void loadInternals(){ VDP_setTextPalette(3); } -static void loadGame(){ +void loadGame(){ + started = TRUE; loadBg(); loadChrome(); loadFg(); @@ -47,9 +48,10 @@ static void updateGame(){ int main(){ loadInternals(); - loadGame(); + // loadGame(); + loadStart(); while(1){ - updateGame(); + started ? updateGame() : updateStart(); SPR_update(); SYS_doVBlankProcess(); } diff --git a/src/start.h b/src/start.h new file mode 100644 index 0000000..4497daa --- /dev/null +++ b/src/start.h @@ -0,0 +1,71 @@ +// start + +bool selectingStartMenu, aboutShowing; +u8 currentStartMenu; + +#define START_W 32 +#define START_H 28 + +#define START_I 32 + + +// events + +static void loadGameFromStart(){ + selectingStartMenu = FALSE; + aboutShowing = FALSE; + VDP_clearTileMapRect(BG_A, 0, 0, START_W, START_H); + VDP_clearTileMapRect(BG_B, 0, 0, START_W, START_H); + loadGame(); +} + +static void selectStartMenu(){ + selectingStartMenu = TRUE; + switch(currentStartMenu){ + case 0: loadGameFromStart(); break; + } +} + + +// draw + +static void drawStartBg(){ + VDP_fillTileMapRect(BG_B, TILE_ATTR_FULL(PAL2, 0, 0, 0, START_I), 0, 0, START_W, START_H); +} + +#define LOGO_X 8 +#define LOGO_Y 6 + +static void drawStartLogo(){ + VDP_drawImageEx(BG_B, &startLogo1, TILE_ATTR_FULL(PAL1, 0, 0, 0, START_I + 32), LOGO_X, LOGO_Y, 0, DMA); +} + +#define MENU_X 13 +#define MENU_Y 14 +#define ARROW_X 13 + +static void drawStartMenu(){ + // VDP_drawText(">", ARROW_X, MENU_Y); + VDP_drawText("start?", MENU_X, MENU_Y); + VDP_drawText("HOW-TO", MENU_X, MENU_Y + 2); + VDP_drawText("ABOUT!", MENU_X, MENU_Y + 4); +} + + +// loop + +void loadStart(){ + VDP_setScreenWidth256(); + currentStartMenu = 0; + VDP_loadTileSet(startBg1.tileset, START_I, DMA); + drawStartBg(); + drawStartLogo(); + drawStartMenu(); + VDP_drawText("VER 0.1", 1, 26); + + // loadGameFromStart(); +} + +void updateStart(){ + if((ctrl.a || ctrl.start) && !aboutShowing && !selectingStartMenu) selectStartMenu(); +} \ No newline at end of file