void UpdateLevel(void) { EventLevel(); // This should be the last line in this function UpdatePlayerPosition(&CurrentPlayer); }
void CFreeCamera::Update(float ElapsedTime){ UpdateInputActions(); UpdateCamera(ElapsedTime); UpdateCameraSpeed(); UpdatePlayerPosition(ElapsedTime); }
void TitleScreenModel::Update() { UpdatePlayerPosition(player1_top, Lerp(GetPlayer1TopLeft(EnumValue(court_position)), GetPlayer1TopRight(EnumValue(court_position)), Player1Position())); UpdatePlayerPosition(player1_bottom, Lerp(GetPlayer1BottomLeft(EnumValue(court_position)), GetPlayer1BottomRight(EnumValue(court_position)), Player1Position())); UpdatePlayerPosition(player2_top, Lerp(GetPlayer2TopLeft(EnumValue(court_position)), GetPlayer2TopRight(EnumValue(court_position)), Player2Position())); UpdatePlayerPosition(player2_bottom, Lerp(GetPlayer2BottomLeft(EnumValue(court_position)), GetPlayer2BottomRight(EnumValue(court_position)), Player2Position())); if(player1_position == 1.0f && player2_position == 1.0f) { dynamic_cast<WitchBall *>(ofGetAppPtr())->RunPlayScreen(); return; } world.Step(kTimeStep, kBox2dVelocityIterations, kBox2dPositionIterations); }
void CPlayerManager::UpdatePlayerInfo(PlayerInfo info) { UpdatePlayerState(info.mPlayerId, info.mPlayerState); UpdatePlayerPosition(info.mPlayerId, NNPoint( info.mX, info.mY ) ); UpdatePlayerRotation(info.mPlayerId, info.mAngle); UpdatePlayerMoveDirection(info.mPlayerId, info.mMoveVelocity); UpdatePlayerHP(info.mPlayerId, info.mHP); UpdatePlayerTeam(info.mPlayerId, info.mTeam); UpdatePlayerType(info.mPlayerId, (PlayerType)info.mType); //UpdatePlayerNickname(info.mPlayerId, info.mName); UpdatePlayerKillScore( info.mPlayerId, info.mKillScore ); }
int main(int ac, char **av) { sConfig->addParam("-a", "--addr", "map generator address", TYPE_FLAG_AND_VALUE, "127.0.0.1"); sConfig->addParam("-p", "--port", "map generator port", TYPE_FLAG_AND_VALUE, "9000"); sConfig->parseParam(ac, av); srand(time(NULL)); //map = MapGenerator::CreateNewRandomMap(WIDTH, HEIGHT, 0.35, 0.35); map = MapGenerator::GetNewMapFromNode(WIDTH, HEIGHT, 0.35, 0.42, sConfig->getFlagValue("-a"), sConfig->getFlagValue("-p")); player = new Object(2, 7.0f, 7.0f, 0.0f, 0.0f); map->AddObject(player); glutInit(&ac, av); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(1280, 720); glutCreateWindow("OpenGL fps"); glClearColor(0.2, 0.2, 0.2, 1.0); glEnable(GL_DEPTH_TEST); for (int i = 0; i < 257; ++i) keyStates[i] = false; glutDisplayFunc(draw); glutReshapeFunc(handleResize); glutSpecialFunc(keySpecial); glutKeyboardFunc(keyPressed); glutKeyboardUpFunc(keyUp); glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); glutIdleFunc(idle); glutVisibilityFunc(visibility); UpdatePlayerPosition(); //keyOperations(); glutPostRedisplay(); glutMainLoop(); return 0; }