Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Revision:
57:1c12361b6e3d
Parent:
53:93338b52489d
diff -r ef9521b7ed78 -r 1c12361b6e3d Entity/Player/Bullets/Bullets.cpp
--- a/Entity/Player/Bullets/Bullets.cpp	Thu May 09 08:42:52 2019 +0000
+++ b/Entity/Player/Bullets/Bullets.cpp	Thu May 09 09:50:19 2019 +0000
@@ -3,55 +3,55 @@
 // Constructor
 Bullets::Bullets(float pos_x, float pos_y, int dir)
 {
-    face = dir;
-    hp = 1;
+    _face = dir;
+    _hp = 1;
     
-    hitbox.width = 3;
-    hitbox.height = 3;
+    _hitbox.width = 3;
+    _hitbox.height = 3;
     
-    position.x = pos_x;
-    position.y = pos_y;
+    _position.x = pos_x;
+    _position.y = pos_y;
     
-    sprite_size.width = 3;
-    sprite_size.height = 3;
-    sprite_size.offset_x = -1;
-    sprite_size.offset_y = -4;
+    _sprite_size.width = 3;
+    _sprite_size.height = 3;
+    _sprite_size.offset_x = -1;
+    _sprite_size.offset_y = -4;
 }
 
 // Functions
 void Bullets::move(float speed, float unused, char * unused2, bool * unused3)   //  Moves regarding face(constant after constructed)
 {
-    if (face == 0) {
-        position.y -= speed;
-    } else if (face == 1) {
-        position.x += speed;
-    } else if (face == 2) {
-        position.y += speed;
-    } else if (face == 3) {
-        position.x -= speed;
+    if (_face == 0) {
+        _position.y -= speed;
+    } else if (_face == 1) {
+        _position.x += speed;
+    } else if (_face == 2) {
+        _position.y += speed;
+    } else if (_face == 3) {
+        _position.x -= speed;
     }
 }
 
 void Bullets::draw(N5110 &lcd)
 {
-    lcd.drawSpriteTransparent(position.x+sprite_size.offset_x,
-                              position.y+sprite_size.offset_y,
-                              sprite_size.height,
-                              sprite_size.width,
+    lcd.drawSpriteTransparent(_position.x+_sprite_size.offset_x,
+                              _position.y+_sprite_size.offset_y,
+                              _sprite_size.height,
+                              _sprite_size.width,
                               (char *) bullets_sprite);
 }
 
 void Bullets::take_damage(int damage)   // Taking damage, currently not used(has to be inherited, as well as useful for possible future use)
 {
-    hp -= damage;
+    _hp -= damage;
 }
 
 bool Bullets::out_of_bounds_check(char * map, bool * doorways)  // Returns true when bullets exit map or collide with walls
 {
-    if (entity_to_map_collision_test(position.x, position.y, map, doorways)) {
+    if (entity_to_map_collision_test(_position.x, _position.y, map, doorways)) {
         return true;
     }
-    if ((0 > position.x) || (position.x > 84) || (0 > position.y) || (position.y > 48)) {
+    if ((0 > _position.x) || (_position.x > 84) || (0 > _position.y) || (_position.y > 48)) {
         return true;
     }
     return false;