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: main.cpp
- Revision:
- 5:1a9d84df7207
- Parent:
- 4:03d13a53308c
- Child:
- 6:85314a3d69cd
--- a/main.cpp Mon Apr 22 16:14:49 2019 +0000
+++ b/main.cpp Sat May 04 10:49:53 2019 +0000
@@ -15,7 +15,10 @@
//#define GROUND_WIDTH 70
#define GROUND_HEIGHT 2
+#define GROUND_WIDTH 50
#define BALL_SIZE 3
+#define LINE_HEIGHT 1
+#define LINE_WIDTH WIDTH
@@ -33,6 +36,7 @@
void update_game(UserInput input);
void render();
+
int main()
{
init();
@@ -43,22 +47,36 @@
falldown.update(pad);
render();
wait(0.1);
+ if (falldown.check_goal() == 1) {
+ //falldown.read_input(pad);
+ //falldown.update(pad);
+ //render();
+ falldown.init(GROUND_HEIGHT,BALL_SIZE,LINE_HEIGHT,LINE_WIDTH);
+ wait(0.1);
+ //clear lines
+ //redraw lines
+ }
}
-}
+ /*while (falldown.check_goal == 1) {
+
+ falldown.init(GROUND_HEIGHT,BALL_SIZE);
+ wait(0.1);*/
+ }
+
void init()
{
lcd.init();
pad.init();
-
- falldown.init(GROUND_HEIGHT,BALL_SIZE);
+
+ falldown.init(GROUND_HEIGHT,BALL_SIZE,LINE_HEIGHT,LINE_WIDTH);
}
void render()
{
-
+
lcd.clear();
falldown.draw(lcd);
lcd.refresh();
-
+
}