2022-06-15 12:47:42 -05:00
|
|
|
/*
|
2022-06-15 12:51:24 -05:00
|
|
|
Slangin'
|
|
|
|
Author: Rudis Muiznieks
|
|
|
|
License: WTFPL
|
2022-06-15 12:47:42 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Arduboy2.h>
|
|
|
|
|
|
|
|
Arduboy2 arduboy;
|
|
|
|
|
2022-06-15 18:36:12 -05:00
|
|
|
enum GameState {
|
|
|
|
STATE_TITLE = 0,
|
|
|
|
STATE_TURN_MENU,
|
|
|
|
STATE_JET_MENU,
|
|
|
|
STATE_PRICE_LIST,
|
|
|
|
STATE_INVENTORY,
|
|
|
|
STATE_BUY_MENU,
|
|
|
|
STATE_SELL_MENU,
|
|
|
|
STATE_FIGHT_MENU,
|
|
|
|
STATE_SHARK_MENU,
|
|
|
|
STATE_BANK_MENU,
|
|
|
|
STATE_INFO_DIALOG,
|
|
|
|
STATE_QUESTION_DIALOG,
|
|
|
|
STATE_AMOUNT_DIALOG,
|
|
|
|
STATE_SUBWAY
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GameLocation {
|
|
|
|
LOC_BRONX = 0,
|
|
|
|
LOC_GHETTO,
|
|
|
|
LOC_CENTRAL_PARK,
|
|
|
|
LOC_MANHATTEN,
|
|
|
|
LOC_CONEY_ISLAND,
|
|
|
|
LOC_BROOKLYN
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Drug {
|
|
|
|
DRUG_COCAINE = 0,
|
|
|
|
DRUG_HEROINE,
|
|
|
|
DRUG_ACID,
|
|
|
|
DRUG_WEED,
|
|
|
|
DRUG_SPEED,
|
|
|
|
DRUG_LUDES
|
|
|
|
};
|
|
|
|
|
|
|
|
enum StatusType {
|
|
|
|
STATUS_NONE = 0,
|
|
|
|
STATUS_TURN,
|
|
|
|
STATUS_FIGHT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum DialogType {
|
|
|
|
DIALOG_INFO = 0,
|
|
|
|
DIALOG_YESNO,
|
|
|
|
DIALOG_AMOUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
bool screenInitialized;
|
|
|
|
StatusType showStatus;
|
|
|
|
GameState gameState;
|
|
|
|
int sCurrentDay;
|
|
|
|
char sTitle[21] = {0};
|
|
|
|
char sMenuItems[8][9] = {0};
|
|
|
|
int pMoney;
|
|
|
|
int pLoanAmount;
|
|
|
|
int pSavingsAmount;
|
|
|
|
GameLocation pLocation;
|
|
|
|
int pGuns;
|
|
|
|
int pCapacity;
|
|
|
|
int pHealth;
|
|
|
|
int pInventory[6] = {0};
|
|
|
|
|
2022-06-15 12:47:42 -05:00
|
|
|
void setup() {
|
2022-06-15 18:36:12 -05:00
|
|
|
gameState = STATE_TITLE;
|
|
|
|
screenInitialized = false;
|
2022-06-15 12:47:42 -05:00
|
|
|
arduboy.begin();
|
|
|
|
arduboy.setFrameRate(15);
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
if (!(arduboy.nextFrame()))
|
|
|
|
return;
|
|
|
|
|
2022-06-15 18:36:12 -05:00
|
|
|
if (!screenInitialized) {
|
|
|
|
switch (gameState) {
|
|
|
|
case STATE_TITLE:
|
|
|
|
showStatus = STATUS_NONE;
|
|
|
|
strcpy(sTitle, " Slangin' v0.9");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
showStatus = STATUS_NONE;
|
|
|
|
strcpy(sTitle, "[UNIMPLEMENTED]");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
drawScreen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void drawScreen() {
|
2022-06-15 12:47:42 -05:00
|
|
|
arduboy.clear();
|
2022-06-15 18:36:12 -05:00
|
|
|
arduboy.setCursor(6, 12);
|
|
|
|
arduboy.print(sTitle);
|
2022-06-15 12:47:42 -05:00
|
|
|
arduboy.display();
|
|
|
|
}
|