ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

Revision:
85:0094d33fb1da
Parent:
84:d875c6e87398
Child:
86:79cfe806a11d
--- a/spase_ship/space_ship.cpp	Sun Apr 28 14:38:57 2019 +0000
+++ b/spase_ship/space_ship.cpp	Sun Apr 28 14:50:01 2019 +0000
@@ -10,4 +10,13 @@
 
 }
 
-void space_ship::init(int x,int height,int width)
\ No newline at end of file
+void space_ship::init(int x,int height,int width)
+{
+    _x = x;  // x value on screen is fixed
+    _y = HEIGHT/2 - height/2;  // y depends on height of screen and height of space_ship
+    _height = height;
+    _width = width;
+    _speed = 1;  // default speed
+    _score = 0;  // start score from zero
+
+}