Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Map/Map.h
- Revision:
- 8:dd1037c5435b
- Parent:
- 7:0af4ced868f5
- Child:
- 9:1ddb8dc93e48
--- a/Map/Map.h Sat Apr 18 16:36:52 2020 +0000
+++ b/Map/Map.h Sun Apr 19 17:46:57 2020 +0000
@@ -7,7 +7,7 @@
#include "Gamepad.h"
/** Map class
-@brief Draws and moves map
+@brief Draws
@author Benjamin Evans, University of Leeds
@date April 2020
*/
@@ -21,7 +21,7 @@
~Map();
/** Initalises Spaceship */
- void init();
+ void init(AnalogIn &adc);
/** Draws a triangle from position with specified hight wich represents a mountain of the map
* @param LCD object, Hight of trangle
@@ -35,24 +35,28 @@
/** Gets 12 random integers between 5 and 12 for the random heights of triangles
* and stores in an array so same random map is drawn when screen refreshesh
+ * @param ADC signal input object
* @return random hieght of the traingle
*/
- void get_random_hight_array();
+ void get_random_hight_array(AnalogIn &adc);
/** Gets 12 random integers between 15 and 30 for the random lengths of lines
* and stores in an array so same random map is drawn when screen refreshesh
- * @return random length of lines
- */
- void get_random_length_array();
+ * @return random length of lines
+ * @param ADC signal input object
+ */
+ void get_random_length_array(AnalogIn &adc);
/** Draws map out of combination of random hight traingle and random length lines so map is differnt each new game
- * @param LCD object,
+ * @param LCD object
*/
void draw_map(N5110 &lcd, int move_map);
+ /** Gets x postion of the map
+ * @return maps x postion
+ */
int get_position_x_map();
- void clear_map(N5110 &lcd);
private:
int position_x_map_;
int position_y_map_;