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.cpp
- Revision:
- 38:09832e662803
- Parent:
- 37:a404860171a9
--- a/Entity/Player/Player.cpp Tue May 07 03:47:39 2019 +0000
+++ b/Entity/Player/Player.cpp Tue May 07 09:09:38 2019 +0000
@@ -4,6 +4,7 @@
// Constructor
Player::Player(float pos_x, float pos_y)
{
+ _type = 0;
moving = false;
face = 0;
hp = 3;
@@ -137,21 +138,13 @@
void Player::draw(N5110 &lcd)
{
- draw_player(lcd);
- draw_bullets(lcd);
-}
-
-void Player::draw_player(N5110 &lcd)
-{
+ // Drawing Player
lcd.drawSpriteTransparent(position.x+sprite_size.offset_x,
position.y+sprite_size.offset_y,
sprite_size.height,
sprite_size.width,
get_frame());
-}
-
-void Player::draw_bullets(N5110 &lcd)
-{
+ // Drawing bullets
for (int i = 0; i < bullets_max; i++) {
if (valid_bullets[i]) {
bullets_array[i]->draw(lcd);