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: N5110 mbed PowerControl
GameScreen.cpp@1:3305d7e44880, 2015-03-07 (annotated)
- Committer:
- AppleJuice
- Date:
- Sat Mar 07 09:58:29 2015 +0000
- Revision:
- 1:3305d7e44880
- Parent:
- 0:c2c1df1163f1
- Child:
- 2:d4402bc3dd45
extended initialization;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AppleJuice | 0:c2c1df1163f1 | 1 | #include "mbed.h" |
AppleJuice | 0:c2c1df1163f1 | 2 | #include "N5110.h" |
AppleJuice | 0:c2c1df1163f1 | 3 | #include "GameScreen.h" |
AppleJuice | 0:c2c1df1163f1 | 4 | |
AppleJuice | 1:3305d7e44880 | 5 | //need to extend on initialization to set some variables |
AppleJuice | 1:3305d7e44880 | 6 | void GameScreen::Initialize() |
AppleJuice | 1:3305d7e44880 | 7 | { |
AppleJuice | 1:3305d7e44880 | 8 | init(); |
AppleJuice | 1:3305d7e44880 | 9 | |
AppleJuice | 1:3305d7e44880 | 10 | platGapSize = 4; |
AppleJuice | 1:3305d7e44880 | 11 | platThickness = 2; |
AppleJuice | 1:3305d7e44880 | 12 | maxX_ = 48; |
AppleJuice | 1:3305d7e44880 | 13 | maxY_ = 84; |
AppleJuice | 1:3305d7e44880 | 14 | |
AppleJuice | 1:3305d7e44880 | 15 | |
AppleJuice | 1:3305d7e44880 | 16 | } |
AppleJuice | 1:3305d7e44880 | 17 | |
AppleJuice | 1:3305d7e44880 | 18 | //draw platform |
AppleJuice | 1:3305d7e44880 | 19 | // ___________ ________ < y |
AppleJuice | 1:3305d7e44880 | 20 | // ^ x |
AppleJuice | 1:3305d7e44880 | 21 | void GameScreen::drawPlatform(int x,int y) |
AppleJuice | 1:3305d7e44880 | 22 | { |
AppleJuice | 1:3305d7e44880 | 23 | |
AppleJuice | 1:3305d7e44880 | 24 | |
AppleJuice | 1:3305d7e44880 | 25 | for (int a = 0; a < 48; a ++) |
AppleJuice | 1:3305d7e44880 | 26 | { |
AppleJuice | 1:3305d7e44880 | 27 | for (int b = y; b < (y+platThickness); b++) |
AppleJuice | 1:3305d7e44880 | 28 | { |
AppleJuice | 1:3305d7e44880 | 29 | setPixel(b,a); |
AppleJuice | 1:3305d7e44880 | 30 | } |
AppleJuice | 1:3305d7e44880 | 31 | } |
AppleJuice | 1:3305d7e44880 | 32 | } |