summaryrefslogtreecommitdiff
path: root/src/toughBird.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/toughBird.cpp')
-rw-r--r--src/toughBird.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/toughBird.cpp b/src/toughBird.cpp
new file mode 100644
index 0000000..51d5cec
--- /dev/null
+++ b/src/toughBird.cpp
@@ -0,0 +1,41 @@
+#include "toughBird.h"
+#include "bullet.h"
+#include "uiDraw.h"
+#include <math.h>
+
+// ToughBird default constructor
+ToughBird :: ToughBird() : Bird()
+{
+ health = 3;
+ setRandomDy( 4.5 , 6.5 );
+}
+
+// Hit ToughBird
+int ToughBird :: hit()
+{
+ if ( health > 1 )
+ {
+ health -= 1;
+ return 1;
+ }
+ else
+ {
+ kill();
+ return 2;
+ }
+ return 0;
+}
+
+
+// Apply gravity to ToughBird
+void ToughBird :: applyGravity ()
+{
+ this->velocity.addDy ( -0.05 );
+}
+
+
+// Draw ToughBird
+void ToughBird :: draw()
+{
+ drawToughBird( point , 15 , health );
+}