Skip to content

Commit

Permalink
fixed funny borders on snake screen
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
  • Loading branch information
j10a1n15 committed Sep 21, 2024
1 parent a01e7c4 commit c9fed3c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/gay/j10a1n15/sillygames/games/Snake.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ class Snake : Game() {
height = 100.percent
}

val cellWidthPercent = 100f / gridWidth
val cellHeightPercent = 100f / gridHeight

val totalGridWidthPercent = cellWidthPercent * gridWidth
val totalGridHeightPercent = cellHeightPercent * gridHeight

val background = UIBlock().constrain {
width = totalGridWidthPercent.percent
height = totalGridHeightPercent.percent
width = ChildBasedSizeConstraint()
height = totalGridHeightPercent.percent()
x = CenterConstraint()
y = CenterConstraint()
color = Color.GREEN.constraint
Expand Down

0 comments on commit c9fed3c

Please sign in to comment.