コード例 #1
0
 @Override
 public void draw(BatchManager.DrawType drawType) {
   super.draw(drawType);
   if (this.shellObject != null) {
     this.shellObject.draw(drawType);
   }
 }
コード例 #2
0
  public ShellObject(BodyData bodyData, int type) {
    this.shellType = type;
    this.bodyData = bodyData;
    this.importExportData = new ImportExportData(1000, 10000, 10, 100, 10000);

    this.shellView = new ShellView(this, "shell.png");

    super.init(bodyData, this.shellView);
  }
コード例 #3
0
  @Override
  public void run() {
    bodyData.addAngle(bodyData.getVelocity() * GameData.getSpeed());

    if (this.shellObject != null) {
      this.shellObject.run();
    }

    super.run();
  }
コード例 #4
0
  public BodyObject(
      BodyData.BodyType type, String planetImage, float distance, float size, float reach) {
    bodyView = new BodyView(planetImage);
    bodyData = new BodyData(type, distance, size * bodyView.getWidth(), reach);
    bodyView.setData(bodyData);

    this.shellObject = null;

    super.init(bodyData, bodyView);
  }
コード例 #5
0
  @Override
  public void update() {
    bodyData.setPosition(
        bodyData.getDistance() * (float) Math.cos(bodyData.getAngle()),
        bodyData.getDistance() * (float) Math.sin(bodyData.getAngle()));

    if (this.shellObject != null) {
      this.shellObject.update();
    }

    super.update();
  }