summaryrefslogtreecommitdiff
path: root/src/bullet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bullet.cpp')
-rw-r--r--src/bullet.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/bullet.cpp b/src/bullet.cpp
new file mode 100644
index 0000000..fc9961b
--- /dev/null
+++ b/src/bullet.cpp
@@ -0,0 +1,25 @@
+#define BULLET_SPEED 10.0
+#define M_PI 3.14159
+#include <cmath>
+#include "bullet.h"
+#include "uiDraw.h"
+#include <iostream>
+using namespace std;
+
+Bullet :: Bullet() : UFO()
+{
+
+}
+
+void Bullet :: draw()
+{
+ drawDot( point );
+}
+
+void Bullet :: fire( Point point , float angle )
+{
+ float dx = BULLET_SPEED * (-cos(M_PI / 180.0 * angle));
+ float dy = BULLET_SPEED * (sin(M_PI / 180.0 * angle));
+ setPoint( point );
+ setVelocity( dx , dy );
+}