parent
c0937fed08
commit
cd55de5ce0
18
slangin.ino
18
slangin.ino
|
@ -353,17 +353,19 @@ void loop() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_GAME_OVER: {
|
case STATE_GAME_OVER: {
|
||||||
int score = floor(sqrt((pSavingsAmount + pMoney - pLoanAmount) / 31.5));
|
dialog[0] = "Game over! Score:";
|
||||||
if (score > 100) score = 100;
|
|
||||||
dialog[0] = "";
|
|
||||||
dialog[1] = " Game over!";
|
|
||||||
dialog[2] = " Your score: ";
|
|
||||||
dialog[2] += String(score);
|
|
||||||
dialog[3] = " out of 100.";
|
|
||||||
dialogSmall = false;
|
dialogSmall = false;
|
||||||
dialogLength = 4;
|
dialogLength = 1;
|
||||||
sPreviousGameState = STATE_TITLE;
|
sPreviousGameState = STATE_TITLE;
|
||||||
|
pMoney += pSavingsAmount - pLoanAmount;
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
pMoney += pInventory[i] * sDrugPrices[i];
|
||||||
|
}
|
||||||
|
if (pMoney < 0) {
|
||||||
|
pMoney = 0;
|
||||||
|
}
|
||||||
drawDialog();
|
drawDialog();
|
||||||
|
drawMoney(10, 20, pMoney);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue