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: Level/Level.cpp
- Revision:
- 6:2ca1516ec1e2
- Child:
- 7:68e06dda79f7
diff -r b9cf407bcc63 -r 2ca1516ec1e2 Level/Level.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Level/Level.cpp Wed Apr 10 11:03:07 2019 +0000
@@ -0,0 +1,25 @@
+#include "Level.h"
+
+Level::Level() {}
+
+Level::~Level() {}
+
+void Level::init(Vector2D blocks [][2] ,int number_of_blocks)
+{
+ for (int i = 0;i<_number_of_blocks;i++) {
+ _blocks[i][0].x = 5; //blocks[i][0].x;
+ _blocks[i][1] = blocks[i][1];
+ }
+ _number_of_blocks = number_of_blocks;
+}
+
+void Level::render(N5110 &lcd)
+{
+ for (int i = 0;i<_number_of_blocks;i++) {
+ Vector2D first = _blocks[i][0];
+ Vector2D second= _blocks[i][1];
+ printf("%f,%f %f,%f\n",first.x,first.y,second.x,second.y);
+ lcd.drawRect(first.x,first.y,second.x,second.y,FILL_BLACK);
+ }
+
+}
\ No newline at end of file