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. |
Beta Was this translation helpful? Give feedback.
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;
} |
Beta Was this translation helpful? Give feedback.
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.