// --- // private void DrawRectangularGameObject(RectangularGameObject rectangularGameObject) { Vector2 topLeft = GetTransformedVector(rectangularGameObject.TopLeft); Vector2 bottomRight = GetTransformedVector(rectangularGameObject.BottomRight); BasicGraphics.DrawSquare(topLeft, bottomRight); }
private void DrawRoomBounds(RectangularGameObject room) { DrawRectangularGameObject(room); GL.Color3(0.1f, 0.1f, 0.1f); DrawBounds(room, 0.003f); }
private void DrawFloor(RectangularGameObject room) { float halfWidth = (room.BottomRight.X - room.TopLeft.X) / 2f; float halfHeight = (room.TopLeft.Y - room.BottomRight.Y) / 2f; Vector2 topLeft = room.TopLeft; Vector2 bottomRight = room.BottomRight; float centerX = topLeft.X + halfWidth; float centerY = topLeft.Y - halfHeight; DrawRectangularTexture(_floorTexture, topLeft, new Vector2(centerX, centerY)); DrawRectangularTexture(_floorTexture, new Vector2(topLeft.X, centerY), new Vector2(centerX, bottomRight.Y)); DrawRectangularTexture(_floorTexture, new Vector2(centerX, topLeft.Y), new Vector2(bottomRight.X, centerY)); DrawRectangularTexture(_floorTexture, new Vector2(centerX, centerY), bottomRight); }
private void DrawExit(RectangularGameObject exit) { Vector2 topLeft = exit.TopLeft; Vector2 bottomRight = exit.BottomRight; Vector2 bottomLeft = new Vector2(topLeft.X, bottomRight.Y); Vector2 topRight = new Vector2(bottomRight.X, topLeft.Y); Vector2 exitVector = bottomRight - topLeft; bool isUpright = Math.Abs(exitVector.X) < Math.Abs(exitVector.Y); Vector2 textureTopLeft = isUpright ? bottomLeft : topLeft; Vector2 textureBottomRight = isUpright ? topRight : bottomRight; if (isUpright) { DrawTexture(_exitTexture, bottomRight, topRight, topLeft, bottomLeft); } else { DrawRectangularTexture(_exitTexture, textureTopLeft, textureBottomRight); } }