multiplayer pong game for LPC 1768

Dependencies:   mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt

Committer:
vsoltan
Date:
Sat Nov 14 02:37:13 2020 +0000
Revision:
17:32ae1f106002
Parent:
16:7fd48cda0773
Child:
18:32fce82690a1
added menu to enter game, JSON de-serialization, and game state update.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vsoltan 16:7fd48cda0773 1
vsoltan 16:7fd48cda0773 2 #include "graphics.h"
vsoltan 16:7fd48cda0773 3
vsoltan 16:7fd48cda0773 4 Graphics::Graphics() {
vsoltan 17:32ae1f106002 5 printf("\n\rInitializing Graphics: initializing TFT\n\r");
vsoltan 16:7fd48cda0773 6 this->tft = new Adafruit_ST7735(P_MOSI, P_MISO, P_SOCK, P_CS, P_RS, P_DC);
vsoltan 17:32ae1f106002 7 printf("Initializing Graphics: optimizing display for resolution\n\r");
vsoltan 17:32ae1f106002 8 tft->initR(INITR_144GREENTAB);
vsoltan 17:32ae1f106002 9 tft->setTextColor(ST7735_WHITE);
vsoltan 16:7fd48cda0773 10 }
vsoltan 16:7fd48cda0773 11
vsoltan 16:7fd48cda0773 12 void Graphics::renderLaunchScreen() {
vsoltan 17:32ae1f106002 13 tft->fillScreen(ST7735_BLACK);
vsoltan 17:32ae1f106002 14 tft->setTextCursor(20, 20);
vsoltan 17:32ae1f106002 15 tft->printf("%s", "Multiplayer Pong");
vsoltan 17:32ae1f106002 16 tft->setTextCursor(20, 80);
vsoltan 17:32ae1f106002 17 tft->printf("%s", "Press any button to continue.");
vsoltan 17:32ae1f106002 18 }
vsoltan 17:32ae1f106002 19
vsoltan 17:32ae1f106002 20 void Graphics::renderBall(GameState *gs) {
vsoltan 16:7fd48cda0773 21
vsoltan 17:32ae1f106002 22 }
vsoltan 17:32ae1f106002 23
vsoltan 17:32ae1f106002 24 void Graphics::renderPlayers(GameState *gs) {
vsoltan 17:32ae1f106002 25 }
vsoltan 16:7fd48cda0773 26
vsoltan 16:7fd48cda0773 27 void Graphics::renderGameState(GameState *gs) {
vsoltan 17:32ae1f106002 28 tft->fillScreen(ST7735_RED);
vsoltan 16:7fd48cda0773 29 }