multiplayer pong game for LPC 1768
Dependencies: mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt
graphics.h@24:05eb0b0ab554, 2020-11-16 (annotated)
- Committer:
- vsoltan
- Date:
- Mon Nov 16 03:34:34 2020 +0000
- Revision:
- 24:05eb0b0ab554
- Parent:
- 23:c38680c32552
- Child:
- 27:fcc5fee18a24
can send move input and fixed graphics bugs;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vsoltan | 16:7fd48cda0773 | 1 | |
vsoltan | 16:7fd48cda0773 | 2 | #ifndef GRAPHICS_H |
vsoltan | 16:7fd48cda0773 | 3 | #define GRAPHICS_H |
vsoltan | 16:7fd48cda0773 | 4 | |
vsoltan | 16:7fd48cda0773 | 5 | #include "Adafruit_ST7735.h" |
vsoltan | 16:7fd48cda0773 | 6 | #include "gamestate.h" |
vsoltan | 16:7fd48cda0773 | 7 | |
vsoltan | 16:7fd48cda0773 | 8 | #define P_MOSI p5 |
vsoltan | 16:7fd48cda0773 | 9 | #define P_MISO p6 |
vsoltan | 16:7fd48cda0773 | 10 | #define P_SOCK p7 |
vsoltan | 16:7fd48cda0773 | 11 | #define P_CS p9 |
vsoltan | 16:7fd48cda0773 | 12 | #define P_RS p20 |
vsoltan | 16:7fd48cda0773 | 13 | #define P_DC p19 |
vsoltan | 16:7fd48cda0773 | 14 | |
vsoltan | 22:1c49e1fae846 | 15 | #define BACKGROUND_COLOR ST7735_BLACK |
vsoltan | 22:1c49e1fae846 | 16 | #define LAUNCH_SCREEN_COLOR ST7735_BLACK |
vsoltan | 22:1c49e1fae846 | 17 | #define WAITING_SCREEN_COLOR ST7735_BLACK |
vsoltan | 22:1c49e1fae846 | 18 | |
vsoltan | 24:05eb0b0ab554 | 19 | #define OTHER_PADDLE_COLOR ST7735_WHITE |
vsoltan | 24:05eb0b0ab554 | 20 | #define YOUR_PADDLE_COLOR ST7735_GREEN |
vsoltan | 24:05eb0b0ab554 | 21 | #define BALL_COLOR ST7735_RED |
vsoltan | 23:c38680c32552 | 22 | |
vsoltan | 23:c38680c32552 | 23 | #define PADDLE_WIDTH 30 |
vsoltan | 23:c38680c32552 | 24 | #define ELEVATION 5 |
vsoltan | 23:c38680c32552 | 25 | |
vsoltan | 18:32fce82690a1 | 26 | class GameState; |
vsoltan | 18:32fce82690a1 | 27 | |
vsoltan | 16:7fd48cda0773 | 28 | class Graphics { |
vsoltan | 16:7fd48cda0773 | 29 | private: |
vsoltan | 16:7fd48cda0773 | 30 | Adafruit_ST7735 *tft; |
vsoltan | 16:7fd48cda0773 | 31 | public: |
vsoltan | 16:7fd48cda0773 | 32 | Graphics(); |
vsoltan | 16:7fd48cda0773 | 33 | void renderLaunchScreen(); |
vsoltan | 18:32fce82690a1 | 34 | void renderWaitingRoom(); |
vsoltan | 16:7fd48cda0773 | 35 | void renderGameState(GameState *gs); |
vsoltan | 17:32ae1f106002 | 36 | void renderBall(GameState *gs); |
vsoltan | 17:32ae1f106002 | 37 | void renderPlayers(GameState *gs); |
vsoltan | 23:c38680c32552 | 38 | void eraseBall(GameState *gs); |
vsoltan | 23:c38680c32552 | 39 | void erasePlayers(GameState *gs); |
vsoltan | 23:c38680c32552 | 40 | void eraseGameState(GameState *gs); |
vsoltan | 23:c38680c32552 | 41 | void reset(); |
vsoltan | 16:7fd48cda0773 | 42 | }; |
vsoltan | 16:7fd48cda0773 | 43 | |
vsoltan | 16:7fd48cda0773 | 44 | #endif // GRAPHICS_H |