public final void Reset() { super.setRotation(0f); this.nextBalls.clear(); this.ballColors.clear(); this.nextBalls.add(Ball.CreateBall(super.getPosition(), MathUtils.random(0x65 - 1) % (Ball.maxColorIndex + 1))); this.nextBalls.add(Ball.CreateBall( super.getPosition().add(Ball.ballGraphWidth * 0.8f, Ball.ballGraphWidth * 0.5f), MathUtils.random(0x65 - 1) % (Ball.maxColorIndex + 1))); this.nextBalls.add(Ball.CreateBall( super.getPosition().add(Ball.ballGraphWidth * 1.6f, Ball.ballGraphWidth * 0.5f), MathUtils.random(0x68 - 1) % (Ball.maxColorIndex + 1))); this.nextBalls.get(0).SetScale(1f); this.nextBalls.get(1).SetScale(0.8f); this.nextBalls.get(2).SetScale(0.8f); }
public Canone() { super.setTexture(LTextures.loadTexture("assets/Canone.png")); super.setPosition(240f, -680f); super.setSource(480, 0, 70, 0x55); super.setOrigin(35f, 55f); this.ballColors = new ArrayList<Integer>(); this.nextBalls = new ArrayList<Ball>(); this.nextBalls.add(Ball.CreateBall(super.getPosition(), MathUtils.random(0x65 - 1) % (Ball.maxColorIndex + 1))); this.nextBalls.add(Ball.CreateBall( super.getPosition().add(Ball.ballGraphWidth * 0.8f, Ball.ballGraphWidth * 0.5f), MathUtils.random(0x65 - 1) % (Ball.maxColorIndex + 1))); this.nextBalls.add(Ball.CreateBall( super.getPosition().add(Ball.ballGraphWidth * 1.6f, Ball.ballGraphWidth * 0.5f), MathUtils.random(0x68 - 1) % (Ball.maxColorIndex + 1))); this.nextBalls.get(0).SetScale(1f); this.nextBalls.get(1).SetScale(0.8f); this.nextBalls.get(2).SetScale(0.8f); }
public final void Fire(Vector2f position, java.util.ArrayList<Ball> objectList) { this.AimToPosition(position); Ball item = this.nextBalls.get(0); this.nextBalls.remove(0); this.nextBalls.get(0).SetPosition(super.getPosition()); this.nextBalls.get(1).SetPosition( super.getPosition().add(Ball.ballGraphWidth * 0.8f, Ball.ballGraphWidth * 0.5f)); this.nextBalls.add(Ball.CreateBall( super.getPosition().add(Ball.ballGraphWidth * 1.6f, Ball.ballGraphWidth * 0.5f), this.ballColors .get(MathUtils.random(this.ballColors.size() - 1)))); item.FireBall(super.getPosition(), Trigonometry.getDirection(super.getRotation() - 1.570796f)); this.nextBalls.get(0).SetScale(1f); this.nextBalls.get(1).SetScale(0.8f); this.nextBalls.get(2).SetScale(0.8f); objectList.add(item); }