![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Adam Baker 201166301
Dependencies: mbed Gamepad N5110
BlockheadEngine/BlockheadEngine.cpp@35:7d69c0822ea9, 2019-05-03 (annotated)
- Committer:
- adambakerwa
- Date:
- Fri May 03 12:30:08 2019 +0000
- Revision:
- 35:7d69c0822ea9
- Parent:
- 34:911d7d05a8d2
- Child:
- 36:6f452777b9ce
safety comit before levels organising
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adambakerwa | 25:230e4163cb6b | 1 | #include "mbed.h" |
adambakerwa | 25:230e4163cb6b | 2 | #include "Gamepad.h" |
adambakerwa | 25:230e4163cb6b | 3 | #include "N5110.h" |
adambakerwa | 25:230e4163cb6b | 4 | #include "BlockheadEngine.h" |
adambakerwa | 25:230e4163cb6b | 5 | |
adambakerwa | 25:230e4163cb6b | 6 | BlockheadEngine::BlockheadEngine() |
adambakerwa | 25:230e4163cb6b | 7 | { |
adambakerwa | 25:230e4163cb6b | 8 | |
adambakerwa | 25:230e4163cb6b | 9 | } |
adambakerwa | 25:230e4163cb6b | 10 | |
adambakerwa | 25:230e4163cb6b | 11 | BlockheadEngine::~BlockheadEngine() |
adambakerwa | 25:230e4163cb6b | 12 | { |
adambakerwa | 25:230e4163cb6b | 13 | |
adambakerwa | 25:230e4163cb6b | 14 | } |
adambakerwa | 25:230e4163cb6b | 15 | |
adambakerwa | 26:3319ddd5111d | 16 | void BlockheadEngine::init() |
adambakerwa | 26:3319ddd5111d | 17 | { |
adambakerwa | 35:7d69c0822ea9 | 18 | _runner.init(); |
adambakerwa | 26:3319ddd5111d | 19 | _pos = _lev.init(_pos); |
adambakerwa | 28:934bb0da48ab | 20 | |
adambakerwa | 27:c0fa8e41743b | 21 | |
adambakerwa | 26:3319ddd5111d | 22 | } |
adambakerwa | 26:3319ddd5111d | 23 | |
adambakerwa | 31:bf765e3961f1 | 24 | void BlockheadEngine::continueInit() |
adambakerwa | 31:bf765e3961f1 | 25 | { |
adambakerwa | 35:7d69c0822ea9 | 26 | _runner.continue_init(); |
adambakerwa | 31:bf765e3961f1 | 27 | _pos = _lev.init(_pos); |
adambakerwa | 31:bf765e3961f1 | 28 | |
adambakerwa | 31:bf765e3961f1 | 29 | |
adambakerwa | 31:bf765e3961f1 | 30 | } |
adambakerwa | 31:bf765e3961f1 | 31 | |
adambakerwa | 25:230e4163cb6b | 32 | int BlockheadEngine::playgame(N5110 &lcd, Gamepad &pad) |
adambakerwa | 25:230e4163cb6b | 33 | { |
adambakerwa | 25:230e4163cb6b | 34 | |
adambakerwa | 34:911d7d05a8d2 | 35 | _level = _runner.next_level(); |
adambakerwa | 34:911d7d05a8d2 | 36 | _pos = _lev.whatLevel(lcd, _level); |
adambakerwa | 35:7d69c0822ea9 | 37 | _runner.blockhead(_pos, lcd, pad); |
adambakerwa | 35:7d69c0822ea9 | 38 | _gameover = _runner.gameover_flag(pad); |
adambakerwa | 25:230e4163cb6b | 39 | |
adambakerwa | 25:230e4163cb6b | 40 | return _gameover; |
adambakerwa | 25:230e4163cb6b | 41 | } |
adambakerwa | 25:230e4163cb6b | 42 |