Ejemplo n.º 1
0
  private void saveStats() {
    Specular.prefs.putInteger(
        "Time Played Ticks", Specular.prefs.getInteger("Time Played Ticks") + ticks);
    Specular.prefs.putInteger(
        "Bullets Fired", Specular.prefs.getInteger("Bullets Fired") + Bullet.bulletsFired);
    Bullet.bulletsFired = 0;

    Specular.prefs.putInteger(
        "Bullets Missed", Specular.prefs.getInteger("Bullets Missed") + Bullet.bulletsMissed);
    Bullet.bulletsMissed = 0;

    Specular.prefs.putInteger(
        "Enemies Killed", Specular.prefs.getInteger("Enemies Killed") + enemiesKilled);
    Specular.prefs.putInteger("Games Played", Specular.prefs.getInteger("Games Played") + 1);

    Specular.prefs.putFloat("Freeze Time", SlowdownEnemies.getFreezeTime());
    // Specular.prefs.putFloat("Boardshock Efficiency", BoardShock.getEfficiency());
    Specular.prefs.putFloat("Burst Max Time", BulletBurst.getMaxActiveTime());
    Specular.prefs.putFloat("Firerate Boost", FireRateBoost.getBoost());
    Specular.prefs.putFloat("Swarm Effect", Swarm.getEffect());
    Specular.prefs.putFloat("Repulsor Max Time", Repulsor.getMaxActiveTime());
    Specular.prefs.putFloat("PDS Damage", PDS.getDamage());
    Specular.prefs.putFloat("Laser Aiming Arc", getPlayer().getLaserArc());
    Specular.prefs.putFloat("Upgrade Points", getPlayer().getUpgradePoints());

    if (player.getScore() > Specular.prefs.getInteger("Highscore"))
      Specular.prefs.putInteger("Highscore", player.getScore());

    Specular.prefs.flush();
  }
Ejemplo n.º 2
0
  @Override
  public void show() {
    super.show();
    // Sets "first" time play to false
    if (Specular.prefs.getBoolean("First Time")) {
      // Start tutorial
      startTutorial();

      Specular.prefs.putBoolean("First Time", false);
      Specular.prefs.flush();
    } else if (MenuInputProcessor.helpPressed()) {
      Specular.prefs.putBoolean("First Time", false);
      startTutorial();
    }

    if (!Specular.prefs.getBoolean("MusicMuted")) {
      randomizeMusic();
    }

    if (GfxSettings.ReturnSetting() == GfxSettings.LOW) {
      PARTICLE_LIMIT = 50;
    } else if (GfxSettings.ReturnSetting() == GfxSettings.MEDIUM) {
      PARTICLE_LIMIT = 150;
    } else {
      PARTICLE_LIMIT = 300;
    }

    scoreFontAlpha = 0;

    // Initializing power-up levels
    // AddLife.reloadLevelTextures(Specular.prefs.getFloat("Life Upgrade Grade"));
    BulletBurst.reloadLevelTextures(Specular.prefs.getFloat("Burst Upgrade Grade"));
    FireRateBoost.reloadLevelTextures(Specular.prefs.getFloat("Firerate Upgrade Grade"));
    ScoreMultiplier.reloadLevelTextures(Specular.prefs.getFloat("Multiplier Upgrade Grade"));
    SlowdownEnemies.reloadLevelTextures(Specular.prefs.getFloat("Slowdown Upgrade Grade"));
    // BoardshockPowerUp.reloadLevelTextures(Specular.prefs.getFloat("Board Upgrade Grade"));
    Ricochet.reloadLevelTextures(Specular.prefs.getFloat("Ricochet Upgrade Grade"));
    Repulsor.reloadLevelTextures(Specular.prefs.getFloat("Repulsor Upgrade Grade"));
    LaserPowerup.reloadLevelTextures(Specular.prefs.getFloat("Beam Upgrade Grade"));
    Swarm.reloadLevelTextures(Specular.prefs.getFloat("Swarm Upgrade Grade"));
    PDSPowerUp.reloadLevelTextures(Specular.prefs.getFloat("PDS Upgrade Grade"));

    ticks = 0;

    reset();
  }
Ejemplo n.º 3
0
  public GameState(Specular game) {
    super(game);

    // Loading map texture from a internal directory
    Texture mapTexture = new Texture(Gdx.files.internal("graphics/game/packed/Level.png"));
    Texture shockLight = new Texture(Gdx.files.internal("graphics/game/packed/ShockLight.png"));
    Texture parallax = new Texture(Gdx.files.internal("graphics/game/packed/Parallax.png"));

    // Loading gameover textures
    gameOverTex = new Texture(Gdx.files.internal("graphics/game/packed/Background.png"));
    newHighscore = new Texture(Gdx.files.internal("graphics/menu/gameover/New Highscore.png"));

    // Loading pause menu textures
    pauseTex = new Texture(Gdx.files.internal("graphics/menu/pausemenu/Pause.png"));
    greyPixel = new Texture(Gdx.files.internal("graphics/menu/pausemenu/Grey Pixel.png"));

    textureAtlas = new TextureAtlas(Gdx.files.internal("graphics/game/packed/Specular.atlas"));

    // Loading HUD
    hud = new HUD(this);

    // Initializing map handler for handling many maps
    mapHandler = new MapHandler();
    mapHandler.addMap(
        "Map",
        mapTexture,
        shockLight,
        parallax,
        mapTexture.getWidth(),
        mapTexture.getHeight(),
        this);
    currentMap = mapHandler.getMap("Map");

    clipBounds = new Rectangle(0, 0, currentMap.getWidth(), currentMap.getHeight());

    // Initializing font
    FreeTypeFontGenerator fontGen =
        new FreeTypeFontGenerator(Gdx.files.internal("fonts/Battlev2l.ttf"));
    FreeTypeFontParameter ftfp = new FreeTypeFontParameter();
    ftfp.size = 96; // MAX SIZE
    ftfp.characters = "1234567890,";
    gameOverScoreFont = fontGen.generateFont(ftfp);
    gameOverScoreFont.setColor(Color.RED);

    ftfp.characters = "1234567890,tapocniue"; // Characters for "Tap to continue"
    ftfp.size = 64;
    scoreFont = fontGen.generateFont(ftfp);
    scoreFont.setColor(Color.RED);

    ftfp.characters = "1234567890,x";
    ftfp.size = 40;
    multiplierFont = fontGen.generateFont(ftfp);
    multiplierFont.setColor(Color.RED);

    // Tutorial (Must be initialized before fontGen.dispose())
    tutorial = new Tutorial(this, fontGen);

    fontGen.dispose();
    // Graphics Settings
    GfxSettings.init();

    // Tutorial
    Tutorial.init(textureAtlas);

    // Initializing entities and analogstick statically
    Player.init(textureAtlas);
    Bullet.init(this);
    Particle.init(textureAtlas);
    UpgradeOrb.init(textureAtlas);
    EnemyWanderer.init(textureAtlas);
    EnemyCircler.init(textureAtlas);
    EnemyStriver.init(textureAtlas);
    EnemyBooster.init(textureAtlas);
    EnemyWorm.init(textureAtlas);
    EnemyVirus.init(textureAtlas);
    EnemyShielder.init(textureAtlas);
    EnemyExploder.init(textureAtlas);
    EnemyDasher.init(textureAtlas);
    EnemyTanker.init(textureAtlas);
    AnalogStick.init(hud);

    // Initializing power-ups
    AddLife.init(textureAtlas);
    BulletBurst.init(textureAtlas);
    FireRateBoost.init(textureAtlas);
    ScoreMultiplier.init(textureAtlas);
    ShieldPowerUp.init(textureAtlas);
    SlowdownEnemies.init(textureAtlas);
    BoardshockPowerUp.init(textureAtlas);
    Ricochet.init(textureAtlas);
    Repulsor.init(textureAtlas);
    LaserPowerup.init(textureAtlas);
    ShockWaveRenderer.init(textureAtlas);
    Laser.init(this);
    Swarm.init(textureAtlas);
    PDSPowerUp.init(textureAtlas);

    pss = new PlayerSpawnSystem(this);
    puss = new PowerUpSpawnSystem(this);
    pass = new ParticleSpawnSystem(this);
    oss = new OrbSpawnSystem(this);
    cs = new ComboSystem();
    waveManager = new WaveManager(this);

    input = Gdx.input;
  }