multiplayer pong game for LPC 1768

Dependencies:   mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt

Committer:
vsoltan
Date:
Mon Nov 16 03:01:50 2020 +0000
Revision:
23:c38680c32552
Parent:
22:1c49e1fae846
Child:
24:05eb0b0ab554
moving paddles work in progress

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 23:c38680c32552 19 #define PADDLE_COLOR ST7735_GREEN
vsoltan 23:c38680c32552 20 #define BALL_COLOR ST7735_RED
vsoltan 23:c38680c32552 21
vsoltan 23:c38680c32552 22 #define PADDLE_WIDTH 30
vsoltan 23:c38680c32552 23 #define ELEVATION 5
vsoltan 23:c38680c32552 24
vsoltan 18:32fce82690a1 25 class GameState;
vsoltan 18:32fce82690a1 26
vsoltan 16:7fd48cda0773 27 class Graphics {
vsoltan 16:7fd48cda0773 28 private:
vsoltan 16:7fd48cda0773 29 Adafruit_ST7735 *tft;
vsoltan 16:7fd48cda0773 30 public:
vsoltan 16:7fd48cda0773 31 Graphics();
vsoltan 16:7fd48cda0773 32 void renderLaunchScreen();
vsoltan 18:32fce82690a1 33 void renderWaitingRoom();
vsoltan 16:7fd48cda0773 34 void renderGameState(GameState *gs);
vsoltan 17:32ae1f106002 35 void renderBall(GameState *gs);
vsoltan 17:32ae1f106002 36 void renderPlayers(GameState *gs);
vsoltan 23:c38680c32552 37 void eraseBall(GameState *gs);
vsoltan 23:c38680c32552 38 void erasePlayers(GameState *gs);
vsoltan 23:c38680c32552 39 void eraseGameState(GameState *gs);
vsoltan 23:c38680c32552 40 void reset();
vsoltan 16:7fd48cda0773 41 };
vsoltan 16:7fd48cda0773 42
vsoltan 16:7fd48cda0773 43 #endif // GRAPHICS_H