my first pokitto code.
Fork of HelloWorld by
main.cpp@9:2ce6a69010cb, 2018-03-11 (annotated)
- Committer:
- 79859899
- Date:
- Sun Mar 11 09:21:58 2018 +0000
- Revision:
- 9:2ce6a69010cb
- Parent:
- 5:c4a0391b43ac
this is my first pokitto code.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pokitto | 0:2d2a3994d55d | 1 | #include "Pokitto.h" |
79859899 | 9:2ce6a69010cb | 2 | #include "flight.h" |
Pokitto | 0:2d2a3994d55d | 3 | |
79859899 | 9:2ce6a69010cb | 4 | Pokitto::Core game; |
79859899 | 9:2ce6a69010cb | 5 | //#define PROJ_HIRES 0 |
79859899 | 9:2ce6a69010cb | 6 | #define BLINKYPERIOD 500 |
79859899 | 9:2ce6a69010cb | 7 | |
79859899 | 9:2ce6a69010cb | 8 | |
79859899 | 9:2ce6a69010cb | 9 | |
Pokitto | 0:2d2a3994d55d | 10 | |
Pokitto | 0:2d2a3994d55d | 11 | int main () { |
79859899 | 9:2ce6a69010cb | 12 | game.begin(); |
79859899 | 9:2ce6a69010cb | 13 | //game.sound.playTone(1,440,1,0); |
79859899 | 9:2ce6a69010cb | 14 | //game.sound.playMusicStream("feelgood.snd"); |
79859899 | 9:2ce6a69010cb | 15 | // Next 4 lines are just to show the C64 font, you can comment them out by adding // in the start of the line |
79859899 | 9:2ce6a69010cb | 16 | //game.display.setFont(fontC64); |
79859899 | 9:2ce6a69010cb | 17 | //game.display.palette[0] = game.display.RGBto565(0x42, 0x42, 0xe7); //default background is palette[0] |
79859899 | 9:2ce6a69010cb | 18 | //game.display.palette[1] = game.display.RGBto565(0xa5, 0xa5, 0xff); //default foreground is palette[1] |
79859899 | 9:2ce6a69010cb | 19 | //game.display.charSpacingAdjust = 0; //needed for the non-proportional C64 font (normal value=1) |
79859899 | 9:2ce6a69010cb | 20 | //int blinkybox = 0; |
79859899 | 9:2ce6a69010cb | 21 | //long blinkytime = game.getTime(); |
79859899 | 9:2ce6a69010cb | 22 | //int i = 0; |
79859899 | 9:2ce6a69010cb | 23 | flight air1; |
79859899 | 9:2ce6a69010cb | 24 | |
79859899 | 9:2ce6a69010cb | 25 | while (game.isRunning()) { |
79859899 | 9:2ce6a69010cb | 26 | if (game.update()) { |
79859899 | 9:2ce6a69010cb | 27 | air1.move(); |
79859899 | 9:2ce6a69010cb | 28 | air1.display(); |
79859899 | 9:2ce6a69010cb | 29 | |
79859899 | 9:2ce6a69010cb | 30 | |
79859899 | 9:2ce6a69010cb | 31 | |
79859899 | 9:2ce6a69010cb | 32 | // game.display.print("Hello World!"); |
79859899 | 9:2ce6a69010cb | 33 | // game.display.print("**** COMMODORE 64 LIVES ****\n\n"); |
79859899 | 9:2ce6a69010cb | 34 | // game.display.println(" 32K RAM POKITTO SYSTEM \n"); |
79859899 | 9:2ce6a69010cb | 35 | //game.display.println("READY.GOGOGOGOG"); |
79859899 | 9:2ce6a69010cb | 36 | /*if (game.getTime()>blinkytime+BLINKYPERIOD) { |
79859899 | 9:2ce6a69010cb | 37 | blinkybox = 1 - blinkybox; //toggle blinky |
79859899 | 9:2ce6a69010cb | 38 | blinkytime = game.getTime(); // store new time |
79859899 | 9:2ce6a69010cb | 39 | } |
79859899 | 9:2ce6a69010cb | 40 | if (blinkybox) { |
79859899 | 9:2ce6a69010cb | 41 | //game.display.bgcolor = 1; // reverse whitespace color |
79859899 | 9:2ce6a69010cb | 42 | game.display.drawPixel(xcol-1,ycol+3,2); |
79859899 | 9:2ce6a69010cb | 43 | game.display.drawPixel(xcol+1,ycol+3,2); |
79859899 | 9:2ce6a69010cb | 44 | //game.display.bgcolor = 0; // put color the right way again |
79859899 | 9:2ce6a69010cb | 45 | }*/ |
79859899 | 9:2ce6a69010cb | 46 | } |
79859899 | 9:2ce6a69010cb | 47 | } |
79859899 | 9:2ce6a69010cb | 48 | |
79859899 | 9:2ce6a69010cb | 49 | return 1; |
79859899 | 9:2ce6a69010cb | 50 | } |