示例#1
0
        public void DrawDebugBoard(SpriteBatch b)
        {
            int w  = 25;
            int x1 = 10;
            int y1 = 10;
            int x2 = x1 + TiledSize.X * w;
            int y2 = y1 + TiledSize.Y * w;

            for (int i = 0; i <= TiledSize.Y; i++)
            {
                Utility.drawLineWithScreenCoordinates(x1, y1 + i * w, x2, y1 + i * w, b, Color.White);
            }

            for (int j = 0; j <= TiledSize.X; j++)
            {
                Utility.drawLineWithScreenCoordinates(x1 + j * w, y1, x1 + j * w, y2, b, Color.White);
            }

            int px = (int)(x1 + w / 2 + Player.GetBoxPosition().X *w);
            int py = (int)(y1 + w / 2 + Player.GetBoxPosition().Y *w);

            Utility.drawLineWithScreenCoordinates(px, py, (int)(Board.GetDrawPosition(Player.GetBoxPosition().toVector2(), Player.Size).X + (Player.Size.X / 2)), (int)(Board.GetDrawPosition(Player.GetBoxPosition().toVector2(), Player.Size).Y - (Player.Size.Y / 4) + Player.Size.Y), b, Color.White);

            if (Board.nextCollectible == null)
            {
                return;
            }

            int cx = (int)(x1 + w / 2 + Board.nextCollectible.position.X * w);
            int cy = (int)(y1 + w / 2 + Board.nextCollectible.position.Y * w);

            Utility.drawLineWithScreenCoordinates(cx, cy, (int)(Board.nextCollectible.Drawposition.X + Board.nextCollectible.Size.X / 2), (int)(Board.nextCollectible.Drawposition.Y - (Board.nextCollectible.Size.Y / 4) + Board.nextCollectible.Size.Y), b, Color.Yellow);
        }