Exemple #1
0
            public override void Render(Batcher batcher, Camera camera)
            {
                batcher.DrawRect(GameBoard.GetBoardRect(), Constants.LightTile);

                for (int i = 0; i < GameBoard.Instance.Layout.width; i++)
                {
                    for (int j = 0; j < GameBoard.Instance.Layout.height; j++)
                    {
                        if (i % 2 == 0 && j % 2 == 0 || i % 2 != 0 && j % 2 != 0)
                        {
                            continue;
                        }

                        batcher.DrawRect(new Rectangle(
                                             GameBoard.BoardToWorld(new Point(i, j)),
                                             new Point(Constants.CellSize, Constants.CellSize)
                                             ), Constants.DarkTile);
                    }
                }
            }
Exemple #2
0
 private Rectangle GetCellRectangle(Point position) => new Rectangle(GameBoard.BoardToWorld(position), Constants.CellArea);