【发布时间】:2016-05-03 20:36:19
【问题描述】:
我正在创建一个 2D 游戏,我希望能够绘制图块来创建我的游戏世界。我创建了一个List,如下所示:
static private List<Rectangle> tiles = new List<Rectangle>();
public const int TileWidth = 50;
public const int TileHeight = 50;
public static void initialise(Texture2D tileTexture)
{
texture = tileTexture;
tiles.Clear();
tiles.Add(new Rectangle(0, 267, TileWidth, TileHeight));
tiles.Add(new Rectangle(1575,795, TileWidth, TileHeight));
tiles.Add(new Rectangle(1315,267, TileWidth, TileHeight));
tiles.Add(new Rectangle(1051,797, TileWidth, TileHeight));
}
我正在尝试以一种允许我使用数组手动选择放置每个图块的位置的方式将图块生成到我的游戏世界中,但是我在这方面遇到了一些困难。
【问题讨论】:
-
更明确一点,描述你的问题并展示你的尝试。