@Override public void draw(BatchManager.DrawType drawType) { super.draw(drawType); if (this.shellObject != null) { this.shellObject.draw(drawType); } }
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); }
@Override public void run() { bodyData.addAngle(bodyData.getVelocity() * GameData.getSpeed()); if (this.shellObject != null) { this.shellObject.run(); } super.run(); }
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); }
@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(); }