Skip to content

Diagonal movement issue #3

Answered by ChebanovDD
umitgoren asked this question in Q&A
May 17, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

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);
    }

    g…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@umitgoren
Comment options

@ChebanovDD
Comment options

Answer selected by ChebanovDD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #1 on May 19, 2022 03:45.