Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AIn0n committed Dec 15, 2021
1 parent 68f15d4 commit 378bf85
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
20 changes: 20 additions & 0 deletions expandingModel/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"name": "hall",
"minSize": [2, 2],
"expandable": true,
"neighbors": ["kitchen", "elevator"]
},
{
"name": "kitchen",
"minSize": [10, 10],
"expandable": true,
"neighbors": ["hall"]
},
{
"name": "elevator",
"minSize": [4, 4],
"expandable": false,
"neighbors": ["hall"]
}
]
8 changes: 3 additions & 5 deletions expandingModel/print.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ def __init__(self, fieldWidth, fieldHeight) -> None:
self.inter_display = pygame.Surface((fieldWidth, fieldHeight))
self.inter_display.blit(pygame.transform.flip(self.inter_display, False, True), (0, 0))

self.offX = fieldWidth/2
self.offY = fieldHeight/2
self.offX = self.offY = fieldHeight/2

def getCords(self, x, y):
return (x + self.offX,
y + self.offY)
return (x + self.offX, y + self.offY)

def printRect(self, r: Rect, color: tuple) -> None:
x, y = self.getCords(r.a.x, r.a.y)
pygame.draw.rect(self.inter_display, color,
(x, y, r.width_l + r.width_r, r.height_u + r.height_d))
(x, y, r.width_l + r.width_r, r.height_u + r.height_d))

def printAll(self) -> None:
self.scaleSurface()
Expand Down

0 comments on commit 378bf85

Please sign in to comment.