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.
Dependencies: mbed FXOS8700CQ mbed-rtos
Game_one/Game_one.h
- Committer:
- yfkwok
- Date:
- 2019-04-03
- Revision:
- 2:464c7e62d97d
- Child:
- 4:5bc9c4363d31
File content as of revision 2:464c7e62d97d:
#ifndef GAME_ONE_H
#define GAME_ONE_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Coin.h"
#include "Object.h"
#include "Game_one_cha.h"
#include "Score.h"
class Game_one
{
public:
Game_one();
~Game_one();
void init(int speed, int cha, int r);
void render(N5110 &lcd, int cha);
void read_input(Gamepad &pad);
void update(Gamepad &pad, N5110 &lcd);
void draw(N5110 &lcd, int cha);
int get_count();
int update_alt();
void set_alt(int alt);
int print_scores(N5110 &lcd);
private:
void check_player_collect(Gamepad &pad);
void check_player_collide(Gamepad &pad, N5110 &lcd);
void check_miss_coin(Gamepad &pad);
void check_miss_block(Gamepad &pad);
void gameover(N5110 &lcd, Gamepad &pad);
void set_count(int count);
Score music;
Game_one_cha _p1;
int _speed;
int _cha;
int _rand;
// x positions of the player
int _p1x;
Coin _coin;
Object _block;
Direction _d;
float _mag;
int _count;
int _alt;
int _type;
};
#endif