void SVSlime::onTick(void) { checkBallCollision(); handleInputs(); simplePhysics(); constrainToBounds(); }
void GuiGame::startTurn() { AbstractGame::startTurn(); _endTurnButton->enable(); _display = false; handleInputs(); }
void Player::update(double time) { meleeWeapon->update(); physicsComp->prevPos->setX(physicsComp->pos->getX()); physicsComp->prevPos->setY(physicsComp->pos->getY()); handleInputs(); physicsComp->update(time); statsComp->update(); }
int main(int argc, char *argv[]) { init(); glfwInit(); window = glfwCreateWindow(1024, 1024, "OpenGL", nullptr, nullptr); // Windowed glfwMakeContextCurrent(window); glfwSwapInterval(1); glClearColor(0.8f, 0.8f, 0.8f, 0.8f); while(!glfwWindowShouldClose(window)){ float ratio; int width, height; glfwGetFramebufferSize(window, &width, &height); ratio = width / (float) height; glViewport(0, 0, width, height); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-50.0, 562.0, -50.0, 562.0, -1, 1); box.DrawBox(show_grid); drawText(); calculateAcceleration(); handleInputs(); display(); idle(); //Swap front and back buffers glfwSetWindowSizeCallback(window, reshape_window); glfwSwapBuffers(window); //Poll for and process events glfwPollEvents(); } glfwDestroyWindow(window); glfwTerminate(); return EXIT_SUCCESS; }
void wsGameLoop::updateGameState() { wsAssert(_mInitialized, "The object wsGame must be initialized via the startUp() method before use."); wsSounds.updateStreams(); game->onLoop(); handleInputs(); // Update physics game->getCurrentScene()->updatePhysics(frameDuration); handleEvents(); if (quit) { return; } game->getCurrentScene()->updateAnimations(frameDuration); wsMem.swapFrames(); // Swap the current memory buffer on the frame stack }
void Controller::check() { handleInputs(); logic.update(); }