multiplayer pong game for LPC 1768

Dependencies:   mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt

Committer:
vsoltan
Date:
Mon Nov 16 02:04:23 2020 +0000
Revision:
22:1c49e1fae846
Parent:
18:32fce82690a1
Child:
23:c38680c32552
improved ball rendering

Who changed what in which revision?

UserRevisionLine numberNew 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 18:32fce82690a1 19 class GameState;
vsoltan 18:32fce82690a1 20
vsoltan 16:7fd48cda0773 21 class Graphics {
vsoltan 16:7fd48cda0773 22 private:
vsoltan 16:7fd48cda0773 23 Adafruit_ST7735 *tft;
vsoltan 16:7fd48cda0773 24 public:
vsoltan 16:7fd48cda0773 25 Graphics();
vsoltan 16:7fd48cda0773 26 void renderLaunchScreen();
vsoltan 18:32fce82690a1 27 void renderWaitingRoom();
vsoltan 16:7fd48cda0773 28 void renderGameState(GameState *gs);
vsoltan 17:32ae1f106002 29 void renderBall(GameState *gs);
vsoltan 17:32ae1f106002 30 void renderPlayers(GameState *gs);
vsoltan 22:1c49e1fae846 31 void removeBall(GameState *gs);
vsoltan 22:1c49e1fae846 32 void removePlayers(GameState *gs);
vsoltan 22:1c49e1fae846 33 void removeGameState(GameState *gs);
vsoltan 16:7fd48cda0773 34 };
vsoltan 16:7fd48cda0773 35
vsoltan 16:7fd48cda0773 36 #endif // GRAPHICS_H