From 83b0b4cb19d7f0137cde962ee81a900baf2bd953 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Wed, 30 Dec 2020 14:38:34 +0000 Subject: Add switchable texture sets. Fix minimap --- src/main/kotlin/main.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main/kotlin/main.kt') diff --git a/src/main/kotlin/main.kt b/src/main/kotlin/main.kt index 7533287..bc39316 100644 --- a/src/main/kotlin/main.kt +++ b/src/main/kotlin/main.kt @@ -1,12 +1,11 @@ fun main() { val renderer = Renderer(viewportWidth = 320, viewportHeight = 240, outputScale = 3) val textureManager = TextureManager() - .apply { loadTextures() } val camera = Camera( fov = 90, - xPos = 2.0, - yPos = 2.0, - rotation = 90.0 + xPos = 1.2, + yPos = 2.5, + rotation = 60.0 ) val map = Map() val minimap = Minimap(map) @@ -15,10 +14,16 @@ fun main() { val raycaster = Raycaster(stepPrecision = 32) - CameraController(camera, moveSpeed = 0.5, rotateSpeed = 5) { + CameraController(camera, moveSpeed = 1.0, rotateSpeed = 15) { paint(raycaster, context) } + val ui = Ui(textureManager) { + paint(raycaster, context) + } + + textureManager.loadTextures(ui.getSelectedTextureSet()) + // Do an initial paint and wait for input paint(raycaster, context) } -- cgit v1.2.3