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.
Dependencies: mbed
Diff: Level1.cpp
- Revision:
- 18:ff0a53dcb862
- Child:
- 19:4789cb4ca550
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Level1.cpp Mon Apr 01 21:51:08 2019 +0000
@@ -0,0 +1,65 @@
+#include "Level1.h"
+
+Level1::Level1()
+{
+}
+
+Level1::~Level1()
+{
+}
+
+void Level1::level_platforms(N5110 &lcd)
+{
+ lcd.drawRect(0,HEIGHT -1,84,1,FILL_BLACK);
+ lcd.drawRect(11,HEIGHT - 9, 38, 2, FILL_TRANSPARENT);
+ lcd.drawRect(65,HEIGHT - 11, 30, 2, FILL_TRANSPARENT);
+ lcd.drawRect(WIDTH - 9,HEIGHT - 19, 8, 2, FILL_BLACK);
+ lcd.drawRect(22, 25, 48, 2, FILL_BLACK);
+ lcd.drawRect(0, 25, 12, 2, FILL_BLACK);
+ lcd.drawRect(0, 17, 8, 2, FILL_BLACK);
+ lcd.drawRect(0, 9, 27, 2, FILL_BLACK);
+ lcd.drawRect(39, 9, 7, 2, FILL_BLACK);
+ lcd.drawRect(58,9,32,2,FILL_BLACK);
+}
+
+void Level1::soft_blocks(N5110 &lcd)
+{
+ _level.soft_blocks(46, 8, lcd);
+ _level.soft_blocks(52, 8, lcd);
+ _level.soft_blocks(55, 36, lcd);
+ _level.soft_blocks(33, 8, lcd);
+ _level.soft_blocks(27, 8, lcd);
+ _level.soft_blocks(59, 36, lcd);
+}
+
+void Level1::solid_blocks(N5110 &lcd)
+{
+ _level.draw_solid_block(49,37, lcd);
+ _level.draw_solid_block(52,37, lcd);
+ _level.draw_solid_block(45,22, lcd);
+ _level.draw_solid_block(42,22, lcd);
+}
+
+void Level1::keys(N5110 &lcd)
+{
+ _level.draw_key1(79, 12, lcd);
+ _level.draw_key2(25, 0, lcd);
+ _level.draw_key3(40, 4, lcd);
+ _level.draw_key4(62, 6, lcd);
+ _level.draw_key5(75, 0, lcd);
+}
+
+int Level1::spikes(N5110 &lcd)
+{
+ if(_level.spike1(25, 45, lcd)|| _level.spike1(58, 7, lcd) == 1) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+int Level1::keys_collected()
+{
+ int k =_level.keys_collected();
+ return k;
+}
\ No newline at end of file