Exemple #1
0
  public void updateRadial() {
    if (mTicks % 4 != 0 || ((mTicks / 120) % 2 == 0)) {
      return;
    }

    int xv = (int) (MathHelper.cos(mTicks * 5) * 10);
    int yv = (int) (MathHelper.sin(mTicks * 5) * 10);

    mWorld.addBullet(
        new Bullet(
            (int) mEntity.mPosition.X + mEntity.getWidth() / 2,
            (int) mEntity.mPosition.Y,
            xv,
            yv,
            true,
            mWorld));
  }
Exemple #2
0
  public void updateCircle() {
    if (mTicks % 300 != 0) {
      return;
    }
    for (int i = 0; i < 89; ++i) {
      int xv = (int) (MathHelper.cos(i * 4) * 10);
      int yv = (int) (MathHelper.sin(i * 4) * 10);

      mWorld.addBullet(
          new Bullet(
              (int) mEntity.mPosition.X + mEntity.getWidth() / 2,
              (int) mEntity.mPosition.Y,
              xv,
              yv,
              true,
              mWorld));
    }
  }
Exemple #3
0
  public void updateSpokes() {
    if (mTicks % 3 != 0 || ((mTicks / 60) % 2 == 0)) {
      return;
    }

    for (int i = 1; i <= 3; ++i) {
      int xv = (int) (MathHelper.cos(mTicks * 4 + 120 * i) * 10);
      int yv = (int) (MathHelper.sin(mTicks * 4 + 120 * i) * 10);

      mWorld.addBullet(
          new Bullet(
              (int) mEntity.mPosition.X + mEntity.getWidth() / 2,
              (int) mEntity.mPosition.Y,
              xv,
              yv,
              true,
              mWorld));
    }
  }