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@3:e05d4de7690b, 2017-04-21 (annotated)
- Committer:
- el15as
- Date:
- Fri Apr 21 01:34:19 2017 +0000
- Revision:
- 3:e05d4de7690b
- Parent:
- 2:8c5c47b2372d
- Child:
- 5:158e2951654b
Added spikes; Added death and spawn; Added animations for death and spawn; Minor bug fixes
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 "Bitmap.h" |
| el15as | 0:9aa78a94ec93 | 4 | #include "Gamepad.h" |
| el15as | 1:5e5791293388 | 5 | #include "Player.h" |
| el15as | 2:8c5c47b2372d | 6 | #include "GameEngine.h" |
| el15as | 0:9aa78a94ec93 | 7 | |
| el15as | 0:9aa78a94ec93 | 8 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); |
| el15as | 1:5e5791293388 | 9 | Serial pc(USBTX, USBRX); // tx, rx |
| el15as | 0:9aa78a94ec93 | 10 | Gamepad pad; |
| el15as | 2:8c5c47b2372d | 11 | GameEngine game; |
| el15as | 1:5e5791293388 | 12 | Player player; |
| el15as | 0:9aa78a94ec93 | 13 | |
| el15as | 1:5e5791293388 | 14 | void update_screen(); |
| el15as | 0:9aa78a94ec93 | 15 | |
| el15as | 0:9aa78a94ec93 | 16 | int main() |
| el15as | 0:9aa78a94ec93 | 17 | { |
| el15as | 0:9aa78a94ec93 | 18 | lcd.init(); |
| el15as | 1:5e5791293388 | 19 | pad.init(); |
| el15as | 2:8c5c47b2372d | 20 | |
| el15as | 1:5e5791293388 | 21 | lcd.normalMode(); |
| el15as | 1:5e5791293388 | 22 | lcd.setBrightness(1); |
| el15as | 2:8c5c47b2372d | 23 | game.init(1); |
| el15as | 0:9aa78a94ec93 | 24 | lcd.refresh(); |
| el15as | 0:9aa78a94ec93 | 25 | |
| el15as | 0:9aa78a94ec93 | 26 | while(1) { // loop forever |
| el15as | 3:e05d4de7690b | 27 | |
| el15as | 2:8c5c47b2372d | 28 | game.read_input(pad); |
| el15as | 3:e05d4de7690b | 29 | game.update(pad, pc, lcd); |
| el15as | 3:e05d4de7690b | 30 | game.draw(lcd); |
| el15as | 2:8c5c47b2372d | 31 | |
| el15as | 2:8c5c47b2372d | 32 | wait(1.0f/10); // 10 fps |
| el15as | 0:9aa78a94ec93 | 33 | } |
| el15as | 3:e05d4de7690b | 34 | } |