Adam Baker 201166301

Dependencies:   mbed Gamepad N5110

Revision:
42:0dad7c359fa5
Parent:
38:51ed5820ffe5
Child:
44:03059810630d
diff -r 4b20f909bbcb -r 0dad7c359fa5 BlockheadEngine/BlockheadEngine.cpp
--- a/BlockheadEngine/BlockheadEngine.cpp	Wed May 08 15:22:53 2019 +0000
+++ b/BlockheadEngine/BlockheadEngine.cpp	Wed May 08 16:28:13 2019 +0000
@@ -14,7 +14,9 @@
 
 }
 
-void BlockheadEngine::init()                                        //intialise all variables for new game
+
+//intialise all variables for new game
+void BlockheadEngine::init()                                        
 {
     _blockhead.init();                                              //intialise variables in blockhead class
     _pos = _lev.init(_pos);                                         //intialise variables in level class and _pos struct
@@ -22,7 +24,9 @@
 
 }
 
-void BlockheadEngine::continueInit()                                //intialise all variables for continue game 
+
+//intialise all variables for continue game 
+void BlockheadEngine::continueInit()                                
 {
     _blockhead.continue_init();                                     //level not intialised and x/y cordinate of blockhead differs dpending on what level you are on
     _pos = _lev.init(_pos);                                         //initialise variables in level class and _pos struct
@@ -30,7 +34,9 @@
 
 }
 
-int BlockheadEngine::playgame(N5110 &lcd, Gamepad &pad)             //runs the game 'blockhead'
+
+//runs the game 'blockhead'
+int BlockheadEngine::playgame(N5110 &lcd, Gamepad &pad)             
 {
     lcd.clear();                                                    //clear lcd first
     
@@ -44,6 +50,8 @@
     return _gameover;                                               //returns _gameover
 }
 
+
+//returns highscore (the highest level reached by user)
 int BlockheadEngine::highscore()
 {   
     if (_level >= _highscore) {                                     //if level reached is higher than current highscore