multiplayer pong game for LPC 1768
Dependencies: mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt
Diff: gamestate.cpp
- Revision:
- 32:7cbf4d9a82af
- Parent:
- 30:59e9a5409e65
- Child:
- 34:b19f39ad74ac
--- a/gamestate.cpp Sat Nov 28 02:54:12 2020 +0000 +++ b/gamestate.cpp Sat Nov 28 03:22:06 2020 +0000 @@ -10,7 +10,6 @@ this->p2_loc = playerTwoLocation; this->ball_loc = ballLocation; this->has_started = 0; - this->connected = 0; this->countdown = 0; this->is_done = 0; this->score[0] = 0; @@ -31,8 +30,7 @@ void GameState::updateAndRender(MbedJSONValue *serverResponse, Graphics *gfx) { string typeResponse = (*serverResponse)["type"].get<std::string>(); - if (typeResponse == "connected") { - connected = 1; + if (typeResponse == "connected") { if (serverResponse->hasMember("player")) { this->localPlayerNum = (char)(*serverResponse)["player"].get<int>(); } @@ -99,10 +97,6 @@ return this->localPlayerNum; } -char GameState::isConnected() { - return this->connected; -} - int GameState::getCountdown() { return this->countdown; }