@Override
    public void act() {
        if (canMove()) {
            if (head.getSteps() == 0) {
                oldDirection = direction;
                direction = head.getDirection();
            }
            switch (direction) {
                case NORTH:
                    this.animation = upAnimation;
                    this.y--;
                    break;
                case EAST:
                    this.animation = rightAnimation;
                    this.x++;
                    break;
                case SOUTH:
                    this.animation = downAnimation;
                    this.y++;
                    break;
                case WEST:
                    this.animation = leftAnimation;
                    this.x--;
                    break;
            }
        }
        if (head.canMove() && time > 0) {
            time--;
        }
        if (time == 0) {
            move = true;
            direction=head.getDirection();
            time = -1;
        }


    }