Nicholas Wu / Mbed 2 deprecated ELEC2645_Project_el18nw

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Nicholas75179
Date:
Fri May 22 11:15:15 2020 +0000
Parent:
3:4bf3fd0d3fce
Commit message:
Commit 2, attempt to amend faulty API documentation

Changed in this revision

Spaceship/Spaceship.h Show annotated file Show diff for this revision Revisions of this file
diff -r 4bf3fd0d3fce -r 1806215c5cd8 Spaceship/Spaceship.h
--- a/Spaceship/Spaceship.h	Fri May 22 10:45:00 2020 +0000
+++ b/Spaceship/Spaceship.h	Fri May 22 11:15:15 2020 +0000
@@ -3,10 +3,8 @@
 * @author Nicholas Wu
 * @date May, 2020
 */
-
 #ifndef SPACESHIP_H
 #define SPACESHIP_H
-
 #include "mbed.h"
 
 class Spaceship{
@@ -35,6 +33,22 @@
         int HP, gun_FX, explosion_FX;
         // gun_FX and explosion_FX manages sound
         
+        /** Constructor
+        * @param pos_x and pos_y (float) are set to an arbitrary value
+        */
+        Spaceship(){
+            pos_x = 100;
+            pos_y = 100;
+        }
+
+        /** Destructor
+        * @param pos_x and pos_y (float) are set to an arbitrary value
+        */
+        ~Spaceship(){
+            pos_x = 0;
+            pos_y = 0;
+        }
+        
         /** controls import from main
         * @param Y, A, X, B (bool) from buttons,
         * @param x and y (float) from left joystick.