Simple fish eat program
Dependencies: mbed mbed-rtos N5110 ShiftReg Tone
classes/Game.h
- Committer:
- el18a2k
- Date:
- 2021-04-20
- Revision:
- 10:e221bd1ce3ec
- Parent:
- 9:d52c4df02493
- Child:
- 11:7c1e2a9303d3
File content as of revision 10:e221bd1ce3ec:
#ifndef GAME_H #define GAME_H #include "mbed.h" #include "N5110.h" #include "Joystick.h" #include "ShiftReg.h" #include "Graphics.h" struct DIRECTION { Direction joy; }; class Game { public: //plays the game void gamePlay(N5110 &lcd, DIRECTION direction); //draws the playing area void init(N5110 &lcd, int x, int y, int Fish_size); //draws fish void drawFish(N5110 &lcd); //updates fish position void fishPos(DIRECTION direction); //Keeps score int Score(N5110 &lcd); //keeps track of lives int Lives(); //check for collision with other fish int Collision(); //generate enemy fish void enemyFish(N5110 &lcd); private: int _x; int _y; int X; int Y; int lives; int check_width; int rect_width; int barIncrement; int FISH_SIZE; int FISH_HEIGHT; int FISH_WIDTH; float CENTRE_X; float CENTRE_Y; int E_FISH_HEIGHT; int E_FISH_WIDTH; int E_FISH; float E_CENTRE_X; float E_CENTRE_Y; int collision; int x_bound; int y_bound; float centre_xpos; float centre_ypos; int check_score; int SCORE; char _score[14]; int s_length; }; #endif