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:
- 7:0af4ced868f5
- Parent:
- 6:12e8433382b3
- Child:
- 8:dd1037c5435b
--- a/Map/Map.h Thu Apr 16 16:25:53 2020 +0000
+++ b/Map/Map.h Sat Apr 18 16:36:52 2020 +0000
@@ -6,7 +6,6 @@
#include "N5110.h"
#include "Gamepad.h"
-
/** Map class
@brief Draws and moves map
@author Benjamin Evans, University of Leeds
@@ -24,14 +23,42 @@
/** Initalises Spaceship */
void init();
- /** Draws triangle to represent a mountain
- * @param LCD object
+ /** Draws a triangle from position with specified hight wich represents a mountain of the map
+ * @param LCD object, Hight of trangle
+ */
+ void draw_triangle(N5110 &lcd, int triangle_hight);
+
+ /** Draws a horizontal line with specified length to represent flat land on map
+ * @param LCD object, Length of line
+ */
+ void draw_line(N5110 &lcd, int line_length);
+
+ /** 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
+ * @return random hieght of the traingle
*/
- void draw_triangle(N5110 &lcd);
-
+ void get_random_hight_array();
+
+ /** 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();
+
+ /** Draws map out of combination of random hight traingle and random length lines so map is differnt each new game
+ * @param LCD object,
+ */
+ void draw_map(N5110 &lcd, int move_map);
+
+ int get_position_x_map();
+
+ void clear_map(N5110 &lcd);
private:
int position_x_map_;
int position_y_map_;
+ float rand_seed_;
+ int rand_hights_[12];
+ int rand_lengths_[12];
};
#endif
\ No newline at end of file