Labyrinth of the Minotaur A simple roguelike/RPG using a nokia 5110 screen
Dependencies: N5110 PowerControl mbed
Game.h
- Committer:
- ThomasBGill
- Date:
- 2015-05-08
- Revision:
- 26:0dd71fc0ede4
- Child:
- 27:1ad2408ba702
File content as of revision 26:0dd71fc0ede4:
#include "N5110.h" #include "PowerControl/PowerControl.h" #include "PowerControl/EthernetPowerControl.h" #include "WorldBuilder.h" #include "Graphics.h" // vcc sce rst dc mosi clk led N5110 lcd(p5, p6, p7, p8, p11, p13, p21); InterruptIn Act(p22); InterruptIn Start(p23); InterruptIn Up(p24); InterruptIn Down(p25); InterruptIn Left(p26); InterruptIn Right(p27); AnalogIn Noise(p19); #define USR_POWERDOWN (0x104) LocalFileSystem local("local"); // create local filesystem struct TILES { char Symbol; // Symbol for this tile bool Passable; // Can tile be walked on }; TILES TileList[] = { { '#', false }, // 0- WALL { '.', true }, // 1- FLOOR { '+', true }, // 2- ENTER { 'x', true }, // 3- EXIT { '.', true }, // 4- FLOOR_SEEN { '=', true }, // 5- CHEST { '/', true }, // 6- CHEST_OPENED }; struct ITEMS { char ItemName[15]; //Item name int ItemValue; //Damage/ armour value }; ITEMS ItemList[] = { //Weapons { "Dagger", 4 }, //0 { "Axe", 5 }, //1 { "Mace", 6 }, //2 { "Sword", 7 }, //3 { "Warhammer", 8 }, //4 //Armour { "Cloth armour", 1 }, //5 { "Leather armour", 2 }, //6 { "Studded armour", 3 }, //7 { "Chainmail vest", 4 }, //8 { "Plate armour", 5 }, //9 }; struct ENEMIES { char EName[9]; //Enemy name int EHealth; //Enemy health int EDamage; //Enemy damage int EArmour; //Enemy armour int EDodge; //Enemy dodge chance int EHit; //Enemy hit chance int ESpd; //Enemy speed (used for running away during fights) int EPoints; //How many points the monster is worth }; ENEMIES EnemyList[] = { //Name HP Dmg Arm Dg Ht Spd Pts { "Huge Rat", 5, 3, 0, 25, 70, 40, 1 }, //0- Huge Rat { "Goblin", 6, 3, 1, 25, 60, 30, 3 }, //1- Goblin { "Skeleton", 8, 4, 2, 10, 50, 10, 5 }, //2- Skeleton { "Wraith", 5, 4, 0, 40, 60, 50, 10 }, //3- Wraith { "Ogre", 10, 7, 3, 10, 35, 15, 15 }, //4- Ogre { "Minotaur", 15, 8, 4, 20, 45, 100, 50 }, //5- Minotaur }; //Variables int ActFlag = 0; int StartFlag = 0; int DirFlag = 0; //Space type player is on int pSpace; //Player Health int ph = 15; //Player weapon int pw = 0; //0 to 4 //Player armour int pa = 5; //5 to 9 //Player score int score = -100; //100 level, x monster, 10 chest, -2 running away //High scores int HScore1; int HScore2; int HScore3; int HScore4; bool BossFight = false; //Voids int semihost_powerdown(); void ActPressed(); void StartPressed(); void DirPressed(); void writeDataToFile(); void readDataFromFile() void HighScoreCheck() void Intro(); void MainMenu(); void Options(); void LevelScreen(); void GameLoop(); void PlayerCamera(); void PlayerMove(); void Fight(); void MonsterAttack(int m); void StartMenu(); void Map(); void DrawMap(); void FlashPlayerLocation(); void MapLegend(); void Inventory(); void Chest(); void getItem(); void BoobyTrap(); void RevealMap(); void Potion(); void GameOver(); void ScoreScreen(); void HighScoreScreen(); void DrawGraphic(int p, int x, int y);