public void createAsteroid() { // todo as we run lower on asteroids, apply affects to players ship to // simulate entering a planet Asteroid asteroid = new Asteroid(WorldHandler.createAsteroid(stage.getWorld(), stage.getPlanetHandler())); AsteroidActorData data = (AsteroidActorData) asteroid.getActorData(); data.asteroid = asteroid; stage.addAsteroid(asteroid); asteroidCount++; Gdx.app.log( "COUNT", "AsteroidLevel Count: " + asteroidCount + " / " + stage.getPlanetHandler().getAsteriodCount()); if (asteroidCount == stage.getPlanetHandler().getAsteriodCount() && !triggered) { triggered = true; Gdx.app.log("COUNT", "AsteroidLevel complete"); if (obstacleTimer != null) obstacleTimer.cancel(); stage.setUpNormalLevel(); } if (asteroidCount > stage.getPlanetHandler().getAsteriodCount()) { asteroid.getActorData().isRemoved = true; stage.addDead(asteroid.getBody()); } }
public void setActivePlayer(int player) { screen.setActivePlayer(player); if (player == pid) { if (reminderTask.isScheduled()) return; turnReminder.scheduleTask(reminderTask, REMINDER_INTERVAL, REMINDER_INTERVAL); } else cancelReminder(); }
void setVisible(boolean b) { this.isVisible = b; BLINK_TASK.cancel(); TIMER.schedule(BLINK_TASK, getHoldDelay(), getBlinkDelay()); }
private void cancelReminder() { reminderTask.cancel(); turnReminder.clear(); }