Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagonal movement issue #1

Closed
umitgoren opened this issue May 17, 2022 · 1 comment
Closed

Diagonal movement issue #1

umitgoren opened this issue May 17, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@umitgoren
Copy link

Hi, thanks for this a nice piece of work. However, I think I found a bug.

The items don't always move (slide) as expected in slide down fill mode.

m3

Minimal reproduction code and steps

  1. Open the sample app in Unity.
  2. Create a board with 2 diagonal empty tiles around the top-left of the board.
  3. Create a match around the bottom-left corner of the board

You will that empty slots are not filled with the items that should slide diagonally.

@umitgoren umitgoren added the bug Something isn't working label May 17, 2022
@ChebanovDD
Copy link
Collaborator

Hi, thanks for your comment.

Actualy it was my desition to prevent this kind of slides. The SlideDownFillStrategy is provided just as an example, and you are free to write your own slide down logic.

If you want to enable all types of slides down, you can only check the side grid slots in the CanDropDiagonally method as shown below.

private bool CanDropDiagonally(IGameBoard<IUnityGridSlot> gameBoard, IUnityGridSlot gridSlot,
    GridPosition direction, out GridPosition gridPosition)
{
    var sideGridSlot = gameBoard.GetSideGridSlot(gridSlot, direction);

    if (sideGridSlot is { NotAvailable: true })
    {
        return gameBoard.CanMoveDown(sideGridSlot, out gridPosition);
    }

    gridPosition = GridPosition.Zero;
    return false;
}

@LibraStack LibraStack locked and limited conversation to collaborators May 19, 2022
@ChebanovDD ChebanovDD converted this issue into discussion #3 May 19, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants