本文整理汇总了C#中Room.GetCenterY方法的典型用法代码示例。如果您正苦于以下问题:C# Room.GetCenterY方法的具体用法?C# Room.GetCenterY怎么用?C# Room.GetCenterY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room.GetCenterY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRoom
private void AddRoom(Room newRoom) {
CreateRoom (newRoom);
var roomCount = rooms.Count;
if (roomCount > 0) {
AddTunnel (newRoom);
}
lastX = newRoom.GetCenterX ();
lastY = newRoom.GetCenterY ();
if (roomCount > 0) {
tiles [lastX - 1, lastY] = Map.Treasure;
bool coin = Random.Range (0.0F, 1.0F) > 0.75F;
if (coin) {
tiles [lastX + 1, lastY] = Map.Enemy;
} else {
tiles [lastX + 1, lastY] = Map.Zombie;
}
if (this.ExitInd == 0) {
tiles [lastX + 2, lastY + 2] = Map.Exit;
this.ExitInd--;
} else {
this.ExitInd--;
}
}
rooms.Enqueue (newRoom);
}
示例2: AddTunnel
private void AddTunnel(Room newRoom) {
var newX = newRoom.GetCenterX ();
var newY = newRoom.GetCenterY ();
if (pseudorandom.Next(0, 1) == 1) {
// horizontal, then vertical
CreateHorizontalTunnel(lastX, newX, lastY);
CreateVerticalTunnel (lastY, newY, newX);
} else {
CreateHorizontalTunnel(lastX, newX, newY);
CreateVerticalTunnel (lastY, newY, lastX);
}
}