Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Revision:
13:d04a6caba40d
Parent:
11:63e54f6e7939
Child:
14:3361879490b2
diff -r a1c1991835ca -r d04a6caba40d Entity/Bullets/Bullets.cpp
--- a/Entity/Bullets/Bullets.cpp	Tue Apr 23 22:59:12 2019 +0000
+++ b/Entity/Bullets/Bullets.cpp	Wed Apr 24 02:33:33 2019 +0000
@@ -1,15 +1,25 @@
-//#include "Bullets.h"
-//
-//Bullets::Bullets(float pos_x, float pos_y){
-//    moving = false;
-//    face = 0;
-//    hp = 0;
-//    hitbox.width = 2;
-//    hitbox.height = 2;
-//    position.x = pos_x;
-//    position.y = pos_y;
-//    sprite_size.width = 4;
-//    sprite_size.height = 2;
-//    sprite_size.offset_x = 2;
-//    sprite_size.offset_y = 0;
-//}
\ No newline at end of file
+#include "Bullets.h"
+
+Bullets::Bullets(float pos_x, float pos_y, int dir){
+    moving = true;
+    face = 0;
+    hp = 1;
+    hitbox.width = 2;
+    hitbox.height = 2;
+    position.x = pos_x;
+    position.y = pos_y;
+    sprite_size.width = 2;
+    sprite_size.height = 2;
+    sprite_size.offset_x = 0;
+    sprite_size.offset_y = 0;
+    direction = dir;
+}
+
+void Bullets::move(float speed, float unused){
+    position.x += (direction < 2)*speed;
+    position.y += (direction < 2)*speed;
+}
+
+int * Bullets::get_frame(){
+    return (int *) bullets_sprite;
+}
\ No newline at end of file