void Game::update(float interval) { updateEnvironment(interval); switch (mGameState) { case STATE_MENU: break; case STATE_WAITING: updateBall(sgoBall, interval); if ((sgoBall.pos() - sgLookat).len() < 1.0f) { mCounter = 0.0f; mGameState = STATE_COUNTDOWN; } break; case STATE_COUNTDOWN: mCounter += interval; if (mCounter > COUNTDOWN_TIME) { enableBall(); mGameState = STATE_RUNNING; } case STATE_RUNNING: if (wasKeyPressed(KEY_ESC)) { Main::pushState(gScreenMain2); } /* manually switch features */ if (wasFunctionPressed(1)) { setBallShadow(!useBallShadow()); } if (wasFunctionPressed(2)) { setReflection(!useReflection()); } if (wasFunctionPressed(5)) { suspend(); toggleMouseControl(); resume(); } updateBall(sgoBall, interval); break; } updateGameField(sgoBall); }
Material::Material() { setReflection(Vector3(0)); setRefraction(Vector3(0), 1); setShininess(infinity); //Default to a perfectly reflective surface if the specular component is non-zero }