package de.thdeg.greiner.superpangworld.graphics.moveable;

import de.thdeg.greiner.superpangworld.gameview.GameView;
import de.thdeg.greiner.superpangworld.graphics.base.Bubble;
import de.thdeg.greiner.superpangworld.graphics.base.CollidableGameObject;

import java.util.ArrayList;

/**
 * The rare hexagonal bubble.
 */
public class HexagonalBubble extends Bubble {

    /**
     * Create a hexagonal bubble with default values.
     *
     * @param gameView the {@link GameView} to display the bubble
     * @param objectsToCollideWith the list of {@link CollidableGameObject} the bubble can collide with
     */
    public HexagonalBubble(GameView gameView, ArrayList<CollidableGameObject> objectsToCollideWith) {
        super(gameView,objectsToCollideWith);

        size=0.6;
        speedInPixel = 2;

        width = (int) (128 * size);
        height = (int) (128 * size);

        this.hitBox.width = width-20;
        this.hitBox.height = height-20;
    }

    @Override
    protected void updateHitBoxPosition() {
        hitBox.x = (int) (position.x+10);
        hitBox.y = (int) (position.y+10);
    }

    @Override
    public void addToCanvas() {
        gameView.addImageToCanvas("hexagon.png",position.x,position.y,size,rotation);
    }

    @Override
    public void updateStatus() {

    }

    @Override
    public void updatePosition() {
        super.updatePosition();
        rotation = (rotation + 1) % 360;
    }
}
