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 MotionSensor
Diff: Entity/Player/Player.h
- Revision:
- 22:7abf4581bc9b
- Parent:
- 16:ddb203a74dfc
- Child:
- 23:5a8f75e93508
--- a/Entity/Player/Player.h Thu Apr 25 03:32:36 2019 +0000
+++ b/Entity/Player/Player.h Thu Apr 25 05:53:30 2019 +0000
@@ -5,28 +5,32 @@
const int bullets_max = 20;
-class Player : public Entity {
- public:
+class Player : public Entity
+{
+public:
// Constructors
Player(float, float);
-
+
// Functions
virtual void move(float, float);
virtual int * get_frame();
void buttons(bool, bool, bool, bool);
-
+
// accessors
int get_attack();
-
+ int get_bullet_speed();
+
// variables
Bullets *bullets_array[bullets_max];
bool valid_bullets[bullets_max];
int fire_rate_counter;
int fire_rate_delay;
+ int _bullet_speed;
};
const int sprite_player [4][4][12][6] = { // Player [Face][SpriteAnimationFrame][Size_Y][Size_X]
- { // Up
+ {
+ // Up
{
{0,1,1,1,1,0,},
{1,1,1,1,1,1,},
@@ -84,7 +88,8 @@
{0,0,0,0,1,0,}
}
},
- { // Right
+ {
+ // Right
{
{0,1,1,1,1,0,},
{1,1,1,1,1,1,},
@@ -201,7 +206,8 @@
{0,0,0,0,1,0,}
}
},
- { // Left
+ {
+ // Left
{
{0,1,1,1,1,0,},
{1,1,1,1,1,1,},