summaryrefslogtreecommitdiff
path: root/src/bullet.cpp
diff options
context:
space:
mode:
authorLogan Hunt <loganthebean222@gmail.com>2020-08-12 14:13:50 -0600
committerLogan Hunt <loganthebean222@gmail.com>2020-08-12 14:13:50 -0600
commit70ea8877ace50d2ce609d7d5f721c887b0ea83ec (patch)
tree514aa4f3d10b0a1db21928f8a002aa10458ecbb5 /src/bullet.cpp
parent495f771530ce1869098bc568f34c243697cab73c (diff)
downloadskeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.tar.gz
skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.zip
Added files
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 );
+}