示例#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();
  }