Example #1
0
  public static void wave1(LinkedList<Enemy> enemyScript) {

    LinkedList<Bullet> bullets;
    Enemy e;

    enemyScript.add(new Node<Enemy>(Enemies.doomBot(30, true), 0));

    enemyScript.add(new Node<Enemy>(Enemies.doomBot(40, false), 1));

    enemyScript.add(new Node<Enemy>(Enemies.doomBot(30, true), 1));

    for (int i = 0; i < 10; i++) {
      bullets = new LinkedList<Bullet>();
      e = new Enemy(new Vector2(1, 40), 1, 2, new PathList(), new LinkedList<Bullet>());

      e.bulletScript.add(Barrage.fire(0.5f, 100, 1, 1, e));
      e.pathlist.add(new Node<Path>(new Path(new Vector2(5, 0)), 0));

      enemyScript.add(new Node<Enemy>(e, 1));
    }

    for (int i = 0; i < 10; i++) {
      e =
          new Enemy(
              new Vector2(10, 30),
              1,
              50,
              new PathList(new Vector2(5, 0)),
              new LinkedList<Bullet>());
      enemyScript.add(new Node<Enemy>(e, 1));
    }

    Enemy teruyo =
        new Enemy(
            new Vector2(0, 30), 1, 50, new PathList(new Vector2(5, 0)), new LinkedList<Bullet>());

    teruyo.isBoss = true;

    teruyo.pathlist.pathlist.add(new Node<Path>(new Path(-5, 0), 1f));

    teruyo.pathlist.pathlist.add(new Node<Path>(new Path(1, 0), 0.5f));

    for (int i = 0; i < 100; i++) {
      teruyo.pathlist.pathlist.add(new Node<Path>(new Path(10, 0), 0.5f));
      teruyo.pathlist.pathlist.add(new Node<Path>(new Path(-10, 0), 0.5f));
    }

    bullets = teruyo.bulletScript;

    for (int i = 0; i < 100; i++) {
      bullets.add(new Node<Bullet>(new Bullet(teruyo, 1, new Path(0, -5)), 1));
      bullets.add(new Node<Bullet>(new Bullet(teruyo, 1, new Path(2, -5)), 0.5f));
    }

    enemyScript.add(new Node<Enemy>(teruyo, 1f));
  }
Example #2
0
  public void draw(Graphics2D g) {
    // if (notOnScreen()) return;

    setMapPosition();

    super.draw(g);
  }
  public void update() {
    player.update();
    player.checkAttack(enemies);

    finish.update();
    finish.checkGrab(player);

    System.out.println(player.getx());
    System.out.println(player.gety());

    bg.setPosition(tileMap.getx(), tileMap.gety());

    tileMap.setPosition(GamePanel.WIDTH / 2 - player.getx(), GamePanel.HEIGHT / 2 - player.gety());

    if (player.isDead()) {
      player.setPosition(130, 2375);
      player.revive();
      player.reset();
      restart();
    }

    //		for(int i = 0; i < drinks.size(); i++){
    //			Alcohol a = drinks.get(i);
    //			a.update();
    //			if(a.shouldRemove()){
    //				drinks.remove(i);
    //				i--;
    //			}
    //		}
    //
    for (int i = 0; i < enemies.size(); i++) {
      Enemy e = enemies.get(i);
      e.update();
      if (player.isDrunk()) {
        e.kill();
      }
      if (e.isDead()) {
        enemies.remove(i);
        e.addScore(Level2State.score);
        i--;
      }
    }

    bg.setPosition(tileMap.getx(), tileMap.gety());
  }
Example #4
0
 public void draw(java.awt.Graphics2D g) {
   setMapPosition();
   super.draw(g);
 }