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.
Blocks/Blocks.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-04-18
- Revision:
- 36:dfdd619874ae
- Parent:
- 19:05cc9f801468
- Child:
- 37:ee47699915b8
File content as of revision 36:dfdd619874ae:
#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.
*/
int 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;
int times;
int pos;
int blockdrop;
int caseselect[5];
int i;
int send;
private:
int k;
int _bx; //block x
int _by; //block y
Vector2D _velocity;
};
#endif