
Ball drop game with menus and highscore tracking developed for ELEC2645 at the University of Leeds.
Dependencies: N5110 mbed PowerControl
Game developed for ELEC 2645.
Extremely detailed report outlining all aspects of project found below. /media/uploads/AppleJuice/projectreport.pdf
Revision 7:1bcd54606f34, committed 2015-03-10
- Comitter:
- AppleJuice
- Date:
- Tue Mar 10 03:07:11 2015 +0000
- Parent:
- 6:b1c54f8b28fe
- Child:
- 8:ebddb721f1ee
- Commit message:
- text is successfully rotated. ; ; To be done: get game working with good difficulty, start menu, pause menu/button, game end screen, high scores.;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Mar 10 02:32:10 2015 +0000 +++ b/main.cpp Tue Mar 10 03:07:11 2015 +0000 @@ -39,7 +39,7 @@ playerBall.y = lcd.getMaxY() - (int)(lcd.getMaxY()/3 * 2) - 5; lcd.Initialize(playerBall); serial.printf("Initialised \n"); - printString("Hey man",40,40); + printString("LVL:",lcd.getMaxX() - 2,-1); serial.printf("done"); /* // move to init @@ -162,7 +162,7 @@ void printString(const char * str,int x,int y) { - serial.printf("Hexa: %#08X \n", *str); + while (*str) { //each byte in row @@ -171,19 +171,19 @@ //each bit in byte for (int b = 0; b < 7; b++) { - if (font5x7[(*str - 32)*5 + i] & 2^b) //bitwise comparison - { - serial.printf("SET (%d,%d) \n",x-i,y+b); + + if (font5x7[(*str - 32)*5 + i] & (1<<b)) //bitwise comparison to mask at desired pixel + { lcd.setPixel(y+b+1,x-i+1); } else { - serial.printf("CLEAR (%d,%d) \n",x-i,y+b); lcd.clearPixel(y+b+1,x-i+1); } } } str ++; + x -= 6; } lcd.refresh();