Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
GameObjects/Blocks/Blocks.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-04-26
- Revision:
- 53:527cf297b088
- Parent:
- 51:387249f9b333
- Child:
- 54:20abd16c7d74
File content as of revision 53:527cf297b088:
#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);
/** Draw Frame
*
* This function draws the Blocks' sides onto the screen.
*/
void DrawFrame(N5110 &lcd);
/** Choose Blocks
*
* This function chooses the correct block using a case structure and draws them onto the screen.
*/
void ChooseBlocks(N5110 &lcd);
/** Update
*
* This function updates the position of the Blocks as they move down the screen.
*/
void update(int blocknum, int blockgap, int srn, int send_block_number);
/** 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 pos;
int caseselect[5];
int i;
int send;
Vector2D velocity;
private:
int _length;
int k;
int _bx; //block x
int _by; //block y
};
#endif