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
Revision 4:64746224ab6e, committed 2020-04-21
- Comitter:
- el17my
- Date:
- Tue Apr 21 13:27:01 2020 +0000
- Parent:
- 3:672d4bd8225d
- Child:
- 5:1dee31b8eeef
- Commit message:
- new file of the explorer
Changed in this revision
explorer/explorer.h | Show annotated file Show diff for this revision Revisions of this file |
line/line.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 672d4bd8225d -r 64746224ab6e explorer/explorer.h --- a/explorer/explorer.h Tue Apr 21 12:31:27 2020 +0000 +++ b/explorer/explorer.h Tue Apr 21 13:27:01 2020 +0000 @@ -1,63 +0,0 @@ -/** explorer -* @the explorer file has three functions - 1 the movement of a explorer to jump and move in left or right direction - 2 check fallen and collision - 3 reset the game -* @date April 15th 2020 -* @author Yaomochu -*/ -#ifndef EXPLORER_H -#define EXPLORER_H - -#include "mbed.h" -#include "Gamepad.h" -//use the enum to define the value we need for the explorer -enum explorer_sprite{Move_right,Move_left,Stand_left, Stand_right}; -//we have four sprite form so we can define the sprite on the screen by using these enum -//the explorer's direction -enum Player_direction {right,left}; - -class Explorer { - public: - Explorer(); - //Constructor - ~Explorer(); - //Destructor -void set_x_coordinate(float joy_x, int speed, Player_direction direction); -void set_y_coordinate(bool ifjump, int jump_height, int level); -int get_y(); - -int get_x(); - -int get_speed(); - -int get_jump_height(); - -Player_direction get_direction(); - -explorer_sprite get_explorer_sprite(); - -int * get_form(explorer_sprite sprite); -//this function is used to get the players form and print on the screen (same as the item file) - -void fall(bool f_flag, Gamepad &gamepad); -//the fall flag need to add music to hint the player that the game is over -void reset_flag(bool reset_flag,Gamepad &gamepad); -//the reset flag also need to add music to hint the player that the game has been reseted -bool get_fall_flag(); - -bool get_reset_flag(); - - private: - - int _x; - int _y; - int _speed; - int _level; - int _jump_height; - bool _f_flag; - bool _r_flag; - Player_direction _player_direction; - explorer_sprite _sprite -}; -#endif
diff -r 672d4bd8225d -r 64746224ab6e line/line.h --- a/line/line.h Tue Apr 21 12:31:27 2020 +0000 +++ b/line/line.h Tue Apr 21 13:27:01 2020 +0000 @@ -0,0 +1,4 @@ +#ifndef LINE_H +#define LINE_H + +#include "mbed.h"