Diagonal movement issue #3
|
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. Minimal reproduction code and steps
You will that empty slots are not filled with the items that should slide diagonally. |
Answered by
ChebanovDD
May 17, 2022
Replies: 1 comment 2 replies
|
Hi, thanks for your comment. Actualy it was my desition to prevent this kind of slides. The If you want to enable all types of slides down, you can only check the side grid slots in the 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;
} |
2 replies
Answer selected by
ChebanovDD
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hi, thanks for your comment.
Actualy it was my desition to prevent this kind of slides. The
SlideDownFillStrategyis 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
CanDropDiagonallymethod as shown below.