Package com.palepail.TestGame.Model.Bullet

Examples of com.palepail.TestGame.Model.Bullet.Bullet


  // ================MISC
  public void shoot(World world) {
    if (isActive()) {
      if (isShooting() && world.getCounter() % fireRate == 0) {
        world.addBullet(new Bullet(Bullet.BULLETSPEED, 0, 1 * Configuration.gameScale,
            1 * Configuration.gameScale, new Vector2((getPosition().x - (getWidth() / 1.3f))
                - ((1 * Configuration.gameScale) / 4), getPosition().y + getHeight() / 2), new Vector2(
                new Vector2(getPosition().x, getPosition().y + 90).sub(getPosition()).nor())));

        world.addBullet(new Bullet(Bullet.BULLETSPEED, 0, 1 * Configuration.gameScale,
            1 * Configuration.gameScale, new Vector2((getPosition().x - (getWidth() / 1.3f))
                + ((1 * Configuration.gameScale) / 4), getPosition().y + getHeight() / 2), new Vector2(
                new Vector2(getPosition().x, getPosition().y + 90).sub(getPosition()).nor())));
        Audio.shoot();
      }
View Full Code Here


    float originalAngle = new Vector2(ship.getPosition().tmp().sub(getPosition()).nor()).angle();

    for (float i = originalAngle - (burstSpread / 2); i <= originalAngle + (burstSpread / 2); i += (burstSpread / burstCount)) {

      float angle = i;
      Bullet bullet = getBasicBullet(ship, bulletScale);
      bullet.getVelocity().setAngle(angle);
      world.addEnemyBullet(bullet);

    }

  }
View Full Code Here

    float originalAngle = new Vector2(ship.getPosition().tmp().sub(getPosition()).nor()).angle();

    for (float i = originalAngle - (burstSpread / 2); i <= originalAngle + (burstSpread / 2); i += (burstSpread / burstCount)) {

      float angle = i;
      Bullet bullet = getBasicBullet(ship, bulletScale);
      bullet.getVelocity().setAngle(angle);
      world.addEnemyBullet(bullet);

    }

  }
View Full Code Here

    }

  }

  public void shootDouble(World world, Ship ship, float bulletScale) {
    Bullet bullet = getBasicBullet(ship, bulletScale);
    bullet.getVelocity().setAngle(this.getRotation());
    world.addEnemyBullet(bullet);

    bullet = getBasicBullet(ship, bulletScale);

    bullet.getVelocity().setAngle(-this.getRotation());
    world.addEnemyBullet(bullet);

  }
View Full Code Here

TOP

Related Classes of com.palepail.TestGame.Model.Bullet.Bullet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.