2014-12-08 52 views

回答

2

game docs沒有提及任何具體的東西。在我看來,你需要通過50x50的矩陣(地圖上的每個方塊)並將數據存儲在Memory中,您可以通過後面的filter形成沼澤瓦片的集合。

2

您可以使用Room.lookForAtArea方法是這樣的:

var terrain = creep.room.lookForAtArea('terrain', 0, 0, 49, 49); 
terrain[5][10] == 'plain'; // tile at y=5 x=10 is plain land 
terrain[25][40] == 'swamp'; // tile at y=25 x=40 is a swamp