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
main.cpp@6:33fd1797beb4, 2017-05-01 (annotated)
- Committer:
- el15as
- Date:
- Mon May 01 22:47:46 2017 +0000
- Revision:
- 6:33fd1797beb4
- Parent:
- 5:158e2951654b
- Child:
- 7:b54323241435
Levels 4 and 5 added; Coin physics programmed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15as | 0:9aa78a94ec93 | 1 | #include "mbed.h" |
el15as | 0:9aa78a94ec93 | 2 | #include "N5110.h" |
el15as | 0:9aa78a94ec93 | 3 | #include "Gamepad.h" |
el15as | 1:5e5791293388 | 4 | #include "Player.h" |
el15as | 2:8c5c47b2372d | 5 | #include "GameEngine.h" |
el15as | 0:9aa78a94ec93 | 6 | |
el15as | 0:9aa78a94ec93 | 7 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); |
el15as | 1:5e5791293388 | 8 | Serial pc(USBTX, USBRX); // tx, rx |
el15as | 0:9aa78a94ec93 | 9 | Gamepad pad; |
el15as | 2:8c5c47b2372d | 10 | GameEngine game; |
el15as | 1:5e5791293388 | 11 | Player player; |
el15as | 0:9aa78a94ec93 | 12 | |
el15as | 1:5e5791293388 | 13 | void update_screen(); |
el15as | 0:9aa78a94ec93 | 14 | |
el15as | 0:9aa78a94ec93 | 15 | int main() |
el15as | 0:9aa78a94ec93 | 16 | { |
el15as | 0:9aa78a94ec93 | 17 | lcd.init(); |
el15as | 1:5e5791293388 | 18 | pad.init(); |
el15as | 2:8c5c47b2372d | 19 | |
el15as | 1:5e5791293388 | 20 | lcd.normalMode(); |
el15as | 1:5e5791293388 | 21 | lcd.setBrightness(1); |
el15as | 6:33fd1797beb4 | 22 | game.init(5); |
el15as | 0:9aa78a94ec93 | 23 | lcd.refresh(); |
el15as | 0:9aa78a94ec93 | 24 | |
el15as | 0:9aa78a94ec93 | 25 | while(1) { // loop forever |
el15as | 3:e05d4de7690b | 26 | |
el15as | 5:158e2951654b | 27 | game.read_input(pad,pc); |
el15as | 3:e05d4de7690b | 28 | game.update(pad, pc, lcd); |
el15as | 3:e05d4de7690b | 29 | game.draw(lcd); |
el15as | 2:8c5c47b2372d | 30 | |
el15as | 2:8c5c47b2372d | 31 | wait(1.0f/10); // 10 fps |
el15as | 0:9aa78a94ec93 | 32 | } |
el15as | 3:e05d4de7690b | 33 | } |