parent
98e6a71b52
commit
c0937fed08
13
slangin.ino
13
slangin.ino
|
@ -81,6 +81,7 @@ const uint8_t PROGMEM spriteWeed[] = {
|
||||||
bool screenInitialized;
|
bool screenInitialized;
|
||||||
GameState sGameState;
|
GameState sGameState;
|
||||||
GameState sPreviousGameState;
|
GameState sPreviousGameState;
|
||||||
|
int sMaxDays;
|
||||||
int sCurrentDay;
|
int sCurrentDay;
|
||||||
long sDrugPrices[6];
|
long sDrugPrices[6];
|
||||||
int sCurrentDrug;
|
int sCurrentDrug;
|
||||||
|
@ -143,7 +144,7 @@ void loop() {
|
||||||
|
|
||||||
// if we're entering the turn menu on day 31 then game is over instead
|
// if we're entering the turn menu on day 31 then game is over instead
|
||||||
if (sGameState == STATE_TURN_MENU
|
if (sGameState == STATE_TURN_MENU
|
||||||
&& sCurrentDay >= 31) {
|
&& sCurrentDay >= sMaxDays) {
|
||||||
sGameState = STATE_GAME_OVER;
|
sGameState = STATE_GAME_OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,13 +152,15 @@ void loop() {
|
||||||
case STATE_TITLE:
|
case STATE_TITLE:
|
||||||
Sprites::drawOverwrite(0, 0, spriteWeed, 0);
|
Sprites::drawOverwrite(0, 0, spriteWeed, 0);
|
||||||
Sprites::drawOverwrite(98, 0, spriteWeed, 0);
|
Sprites::drawOverwrite(98, 0, spriteWeed, 0);
|
||||||
arduboy.setCursor(42, 15);
|
arduboy.setCursor(42, 10);
|
||||||
arduboy.print(F("Slangin'"));
|
arduboy.print(F("Slangin'"));
|
||||||
font3x5.setCursor(103, 58);
|
font3x5.setCursor(103, 58);
|
||||||
font3x5.print(F("v1.1.1"));
|
font3x5.print(F("v1.1.1"));
|
||||||
menu[0] = F("Hit the Streets!!");
|
menu[0] = F("Hit the Streets");
|
||||||
menuLength = 1;
|
menu[1] = F("Extended Game");
|
||||||
menuSmall = false;
|
//menu[2] = F("High Scores");
|
||||||
|
menuLength = 2;
|
||||||
|
menuSmall = true;
|
||||||
menuCols = false;
|
menuCols = false;
|
||||||
drawMenu(menuSmall, menuCols, menuLength, menu);
|
drawMenu(menuSmall, menuCols, menuLength, menu);
|
||||||
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);
|
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);
|
||||||
|
|
|
@ -5,7 +5,7 @@ Author: Rudis Muiznieks
|
||||||
License: WTFPL
|
License: WTFPL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void initializeNewGame() {
|
void initializeNewGame(int days) {
|
||||||
sGameState = STATE_TURN_MENU;
|
sGameState = STATE_TURN_MENU;
|
||||||
pMoney = 2000;
|
pMoney = 2000;
|
||||||
pLoanAmount = 5000;
|
pLoanAmount = 5000;
|
||||||
|
@ -19,6 +19,7 @@ void initializeNewGame() {
|
||||||
pInventory[i] = 0;
|
pInventory[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sMaxDays = days + 1;
|
||||||
sCurrentDay = 0;
|
sCurrentDay = 0;
|
||||||
incrementDay(false); // start on day 1
|
incrementDay(false); // start on day 1
|
||||||
}
|
}
|
||||||
|
@ -198,7 +199,10 @@ void handleMenuAction() {
|
||||||
case STATE_TITLE:
|
case STATE_TITLE:
|
||||||
switch (menuSelected) {
|
switch (menuSelected) {
|
||||||
case 0: // new game
|
case 0: // new game
|
||||||
initializeNewGame();
|
initializeNewGame(30);
|
||||||
|
break;
|
||||||
|
case 1: // extended game
|
||||||
|
initializeNewGame(60);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue