コード例 #1
0
void SVSlime::onTick(void)
{
	checkBallCollision();
	handleInputs();
	simplePhysics();
	constrainToBounds();
}
コード例 #2
0
ファイル: GuiGame.cpp プロジェクト: RobinPetit/WizardPoker
void GuiGame::startTurn()
{
	AbstractGame::startTurn();
	_endTurnButton->enable();

	_display = false;
	handleInputs();
}
コード例 #3
0
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();
}
コード例 #4
0
ファイル: main.cpp プロジェクト: novalain/Modelleringsprojekt
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;
    
}
コード例 #5
0
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
}
コード例 #6
0
ファイル: Controller.cpp プロジェクト: jlonardi/GEA_Demo
void Controller::check()
{
	handleInputs();
	logic.update();
}