Skip to content

Instantly share code, notes, and snippets.

@ChristianHohlfeld
Created October 4, 2018 20:13
Show Gist options
  • Save ChristianHohlfeld/22a2046c150b0975ada3d0695782a6b7 to your computer and use it in GitHub Desktop.
Save ChristianHohlfeld/22a2046c150b0975ada3d0695782a6b7 to your computer and use it in GitHub Desktop.
void HelloWorld::update(float dt) {
if (std::stoi(localProperties.GetProperty("IS_GAMESERVER"))) {
UpdateServer(dt);
}
else {
UpdateClient(dt);
}
//update game state
if(serverGameObject != nullptr){
serverGameObject->setSpritePosition(server->getReceivedXPos(), server->getReceivedYPos());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment