multiplayer pong game for LPC 1768

Dependencies:   mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt

graphics.h

Committer:
vsoltan
Date:
2020-11-16
Revision:
23:c38680c32552
Parent:
22:1c49e1fae846
Child:
24:05eb0b0ab554

File content as of revision 23:c38680c32552:


#ifndef GRAPHICS_H 
#define GRAPHICS_H 

#include "Adafruit_ST7735.h" 
#include "gamestate.h" 

#define P_MOSI  p5
#define P_MISO  p6
#define P_SOCK  p7
#define P_CS    p9
#define P_RS    p20 
#define P_DC    p19

#define BACKGROUND_COLOR        ST7735_BLACK 
#define LAUNCH_SCREEN_COLOR     ST7735_BLACK  
#define WAITING_SCREEN_COLOR    ST7735_BLACK  

#define PADDLE_COLOR    ST7735_GREEN
#define BALL_COLOR      ST7735_RED

#define PADDLE_WIDTH 30 
#define ELEVATION    5  

class GameState; 

class Graphics {
    private: 
        Adafruit_ST7735 *tft; 
    public: 
        Graphics(); 
        void renderLaunchScreen(); 
        void renderWaitingRoom(); 
        void renderGameState(GameState *gs); 
        void renderBall(GameState *gs); 
        void renderPlayers(GameState *gs); 
        void eraseBall(GameState *gs);
        void erasePlayers(GameState *gs); 
        void eraseGameState(GameState *gs);
        void reset();
};

#endif // GRAPHICS_H