From 17d839818ec1e38d83b06313175b028de00a63b3 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Sat, 21 Sep 2024 10:36:36 +0200 Subject: [PATCH] add pip boolean to game Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> --- src/main/kotlin/gay/j10a1n15/sillygames/games/Game.kt | 2 ++ src/main/kotlin/gay/j10a1n15/sillygames/games/Snake.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/kotlin/gay/j10a1n15/sillygames/games/Game.kt b/src/main/kotlin/gay/j10a1n15/sillygames/games/Game.kt index 6335ad7..848ac4c 100644 --- a/src/main/kotlin/gay/j10a1n15/sillygames/games/Game.kt +++ b/src/main/kotlin/gay/j10a1n15/sillygames/games/Game.kt @@ -10,4 +10,6 @@ abstract class Game { open fun onKeyHeld(key: Int) {} open fun onKeyPressed(key: Int) {} + + open val pip = false } diff --git a/src/main/kotlin/gay/j10a1n15/sillygames/games/Snake.kt b/src/main/kotlin/gay/j10a1n15/sillygames/games/Snake.kt index c400438..4e4797b 100644 --- a/src/main/kotlin/gay/j10a1n15/sillygames/games/Snake.kt +++ b/src/main/kotlin/gay/j10a1n15/sillygames/games/Snake.kt @@ -168,4 +168,6 @@ class Snake : Game() { private fun randomLocation(): Vector2d = Vector2d((0 until gridWidth).random(), (0 until gridHeight).random()).let { if (it in snake) randomLocation() else it } + + override val pip = true }