Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Blocks/Blocks.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-04-26
- Revision:
- 47:b448ffd073e7
- Parent:
- 41:4edac50f010d
- Child:
- 48:d774bb162c61
File content as of revision 47:b448ffd073e7:
#ifndef BLOCKS_H #define BLOCKS_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" class Blocks { public: Blocks(); ~Blocks(); /** Initialise Blocks * * This function initialises the Blocks library. */ void init(); /** Draw * * This function draws the Blocks onto the screen. */ void draw(N5110 &lcd, int length, int blockgap); /** Update * * This function updates the position of the Blocks as they move down the screen. */ void update(int blocknum, int srn, int send); /** Get Position * * This function obtains the coordinates of the top-left pixel in the Blocks sprites. */ Vector2D get_pos(); /** Get Number * * This function obtains the number inside the Blocks sprite at a specefic location. */ int * get_number(); /** Set Position * * This function is used to change the position of the sprite to specific coordinates when called. */ void set_pos(Vector2D p); int state; double round; //used to save the rounded number to set the value inside the block. int times; int pos; int caseselect[5]; int i; int send; Vector2D velocity; private: int _length; int k; int _bx; //block x int _by; //block y }; #endif