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:
- 12:a1c1991835ca
- Parent:
- 11:63e54f6e7939
- Child:
- 13:d04a6caba40d
--- a/Entity/Player/Player.h Tue Apr 23 03:10:09 2019 +0000
+++ b/Entity/Player/Player.h Tue Apr 23 22:59:12 2019 +0000
@@ -9,10 +9,247 @@
// Functions
virtual void move(float, float);
+ virtual int * get_frame();
virtual void chkdmg();
void buttons(bool, bool, bool, bool);
};
const float player_speed = 1.2;
+const int sprite_player [4][4][12][6] = { // Player [Face][SpriteAnimationFrame][Size_Y][Size_X]
+ { // Up
+ {
+ {0,1,1,1,1,0,},
+ {1,1,1,1,1,1,},
+ {1,1,1,1,1,1,},
+ {1,1,1,1,1,1,},
+ {0,1,1,1,1,0,},
+ {0,0,1,1,0,0,},
+ {0,1,1,1,1,0,},
+ {1,0,1,1,0,1,},
+ {1,0,1,1,0,1,},
+ {0,0,1,1,0,0,},
+ {0,1,0,0,1,0,},
+ {0,1,0,0,1,0,}
+ },
+ {
+ {0,1,1,1,1,0,},
+ {1,1,1,1,1,1,},
+ {1,1,1,1,1,1,},
+ {1,1,1,1,1,1,},
+ {0,1,1,1,1,0,},
+ {0,0,1,1,0,0,},
+ {0,1,1,1,1,0,},
+ {1,0,1,1,0,1,},
+ {0,0,1,1,0,1,},
+ {0,0,1,1,0,0,},
+ {0,1,0,0,1,0,},
+ {0,1,0,0,0,0,}
+ },
+ {
+ {0,1,1,1,1,0,},
+ {1,1,1,1,1,1,},
+ {1,1,1,1,1,1,},
+ {1,1,1,1,1,1,},
+ {0,1,1,1,1,0,},
+ {0,0,1,1,0,0,},
+ {0,1,1,1,1,0,},
+ {1,0,1,1,0,1,},
+ {1,0,1,1,0,1,},
+ {0,0,1,1,0,0,},
+ {0,1,0,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