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
Levelengine.cpp@2:725c213b2396, 2019-03-20 (annotated)
- Committer:
- el17arm
- Date:
- Wed Mar 20 01:32:31 2019 +0000
- Revision:
- 2:725c213b2396
- Child:
- 3:d27ee2440829
Collision now detected though sprite does not react to collision yet
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17arm | 2:725c213b2396 | 1 | #include <iostream> |
| el17arm | 2:725c213b2396 | 2 | #include "Levelengine.h" |
| el17arm | 2:725c213b2396 | 3 | |
| el17arm | 2:725c213b2396 | 4 | Levelengine::Levelengine() |
| el17arm | 2:725c213b2396 | 5 | { |
| el17arm | 2:725c213b2396 | 6 | } |
| el17arm | 2:725c213b2396 | 7 | |
| el17arm | 2:725c213b2396 | 8 | Levelengine::~Levelengine() |
| el17arm | 2:725c213b2396 | 9 | { |
| el17arm | 2:725c213b2396 | 10 | } |
| el17arm | 2:725c213b2396 | 11 | |
| el17arm | 2:725c213b2396 | 12 | void Levelengine::test_level(N5110 &lcd) |
| el17arm | 2:725c213b2396 | 13 | { |
| el17arm | 2:725c213b2396 | 14 | |
| el17arm | 2:725c213b2396 | 15 | lcd.drawRect(0,HEIGHT-3,WIDTH,3,FILL_BLACK); |
| el17arm | 2:725c213b2396 | 16 | lcd.drawRect(0,30,40,10,FILL_BLACK); |
| el17arm | 2:725c213b2396 | 17 | |
| el17arm | 2:725c213b2396 | 18 | |
| el17arm | 2:725c213b2396 | 19 | |
| el17arm | 2:725c213b2396 | 20 | if(lcd.getPixel(engine._x, engine._y)) |
| el17arm | 2:725c213b2396 | 21 | { |
| el17arm | 2:725c213b2396 | 22 | printf("collision detected\n"); |
| el17arm | 2:725c213b2396 | 23 | |
| el17arm | 2:725c213b2396 | 24 | } |
| el17arm | 2:725c213b2396 | 25 | else |
| el17arm | 2:725c213b2396 | 26 | { |
| el17arm | 2:725c213b2396 | 27 | printf("collision not detected\n"); |
| el17arm | 2:725c213b2396 | 28 | |
| el17arm | 2:725c213b2396 | 29 | } |
| el17arm | 2:725c213b2396 | 30 | |
| el17arm | 2:725c213b2396 | 31 | } |