added 60 day extended mode

closes #4
This commit is contained in:
Rudis Muiznieks 2022-06-21 20:24:49 -05:00
parent 98e6a71b52
commit c0937fed08
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
2 changed files with 14 additions and 7 deletions

View File

@ -81,6 +81,7 @@ const uint8_t PROGMEM spriteWeed[] = {
bool screenInitialized;
GameState sGameState;
GameState sPreviousGameState;
int sMaxDays;
int sCurrentDay;
long sDrugPrices[6];
int sCurrentDrug;
@ -143,7 +144,7 @@ void loop() {
// if we're entering the turn menu on day 31 then game is over instead
if (sGameState == STATE_TURN_MENU
&& sCurrentDay >= 31) {
&& sCurrentDay >= sMaxDays) {
sGameState = STATE_GAME_OVER;
}
@ -151,13 +152,15 @@ void loop() {
case STATE_TITLE:
Sprites::drawOverwrite(0, 0, spriteWeed, 0);
Sprites::drawOverwrite(98, 0, spriteWeed, 0);
arduboy.setCursor(42, 15);
arduboy.setCursor(42, 10);
arduboy.print(F("Slangin'"));
font3x5.setCursor(103, 58);
font3x5.print(F("v1.1.1"));
menu[0] = F("Hit the Streets!!");
menuLength = 1;
menuSmall = false;
menu[0] = F("Hit the Streets");
menu[1] = F("Extended Game");
//menu[2] = F("High Scores");
menuLength = 2;
menuSmall = true;
menuCols = false;
drawMenu(menuSmall, menuCols, menuLength, menu);
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);

View File

@ -5,7 +5,7 @@ Author: Rudis Muiznieks
License: WTFPL
*/
void initializeNewGame() {
void initializeNewGame(int days) {
sGameState = STATE_TURN_MENU;
pMoney = 2000;
pLoanAmount = 5000;
@ -19,6 +19,7 @@ void initializeNewGame() {
pInventory[i] = 0;
}
sMaxDays = days + 1;
sCurrentDay = 0;
incrementDay(false); // start on day 1
}
@ -198,7 +199,10 @@ void handleMenuAction() {
case STATE_TITLE:
switch (menuSelected) {
case 0: // new game
initializeNewGame();
initializeNewGame(30);
break;
case 1: // extended game
initializeNewGame(60);
break;
}
break;