package com.servegame.abendstern.tunnelblick.game;

public final class EnemyFactory {
  private static final float BASE_SPAWN_INTERVAL = 7;
  private final Tunnelblick game;
  private float timeUntilSpawn = 1;

  public EnemyFactory(Tunnelblick tb) {
    game = tb;
  }

  public void update(float et, float difficulty) {
    timeUntilSpawn -= et;
    if (timeUntilSpawn < 0) {
      timeUntilSpawn = (float)((Math.random()+0.2)*BASE_SPAWN_INTERVAL /
                               Math.sqrt(difficulty));

      double what = difficulty * Math.random();
      if (what < 0.5)
        game.field.add(new Cactus(game));
      else
        game.field.add(new FireFern(game));
    }
  }
}

@@ -134,9 +134,9 @@
 L = 
-7
+5
 ;%0A  
@@ -569,11 +569,11 @@
 t %3C 
-0.5
+2.0
 )%0A  

Increase enemy spawn rate.