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 Gamepad N5110
Entrance/Entrance.cpp@7:05f433e196d6, 2019-05-06 (annotated)
- Committer:
- rafeh
- Date:
- Mon May 06 22:55:38 2019 +0000
- Revision:
- 7:05f433e196d6
- Parent:
- 6:bc580b480ac8
- Child:
- 10:75de0f4da176
udating FlappyBirdEngine class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rafeh | 7:05f433e196d6 | 1 | #include "Entrance.h" |
rafeh | 7:05f433e196d6 | 2 | |
rafeh | 7:05f433e196d6 | 3 | void Entrance::welcome_page(N5110 &lcd, Gamepad &pad) { |
rafeh | 7:05f433e196d6 | 4 | |
rafeh | 7:05f433e196d6 | 5 | const int intro_shape [40][40] = |
rafeh | 7:05f433e196d6 | 6 | { |
rafeh | 7:05f433e196d6 | 7 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 8 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 9 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 10 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 11 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 42 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 43 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 44 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 45 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 46 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
rafeh | 7:05f433e196d6 | 47 | |
rafeh | 7:05f433e196d6 | 48 | }; |
rafeh | 7:05f433e196d6 | 49 | |
rafeh | 7:05f433e196d6 | 50 | |
rafeh | 7:05f433e196d6 | 51 | |
rafeh | 7:05f433e196d6 | 52 | |
rafeh | 7:05f433e196d6 | 53 | lcd.drawSprite(0,0,40,40,(int*)intro_shape); |
rafeh | 7:05f433e196d6 | 54 | lcd.printString(" Flappy ",40,0); |
rafeh | 7:05f433e196d6 | 55 | lcd.printString(" Bird ",40,1); |
rafeh | 7:05f433e196d6 | 56 | lcd.printString(" Press ",40,3); |
rafeh | 7:05f433e196d6 | 57 | lcd.printString(" Start ",40,4); |
rafeh | 7:05f433e196d6 | 58 | lcd.refresh(); |
rafeh | 7:05f433e196d6 | 59 | while ( pad.check_event(Gamepad::START_PRESSED) == false) { |
rafeh | 7:05f433e196d6 | 60 | pad.leds_on(); |
rafeh | 7:05f433e196d6 | 61 | wait(0.1); |
rafeh | 7:05f433e196d6 | 62 | pad.leds_off(); |
rafeh | 7:05f433e196d6 | 63 | wait(0.1); |
rafeh | 7:05f433e196d6 | 64 | } |
rafeh | 7:05f433e196d6 | 65 | } |
rafeh | 7:05f433e196d6 | 66 | |
rafeh | 7:05f433e196d6 | 67 | |
rafeh | 7:05f433e196d6 | 68 |