From 2905d40e02150ee6db88a3ecdd1d4bcfa94a8562 Mon Sep 17 00:00:00 2001 From: Tobse Date: Mon, 22 Jun 2020 23:13:15 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=20Update=20to=20latest=20KorGE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 +++++++++---------- gradle.properties | 2 +- .../jam/roguymaze/renderer/FaqComponent.kt | 14 ++++++++------ .../roguymaze/renderer/SettingsComponent.kt | 13 +++++-------- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e2d3650..799296d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎮 🏝 RoguyIsleMaze [![Kotlin](https://img.shields.io/badge/Kotlin-1.3.70-blue.svg?style=flat&logo=kotlin&logoColor=white)](http://kotlinlang.org) -[![Korge](https://img.shields.io/badge/Korge-1.13.2.4-836DAC.svg)](https://korge.soywiz.com/) +[![Korge](https://img.shields.io/badge/Korge-1.13.8.3-836DAC.svg)](https://korge.soywiz.com/) My contribution for the first [KorGE](https://korge.org/) - [GameJam](https://itch.io/jam/korge-gamejam-1) @@ -13,25 +13,24 @@ Your task: 1. Search for all masks - matching every character. 2. Find the right house for each player. -There are always four figures in the game: -(yellow, red, purple, black) +There are always four figures in the game: yellow, red, purple, black. Join a group of up to five players and complete the task. But it is not as easy as it looks. Each player can move any piece at the same time! However, only a limited number of movement options are available to each player! -Only as a team can you complete the task! +You can only complete the task as a team. Before you can reach the next part of the map, you have to use your magnifier to discover it: Move onto a way marker with a question mark with the same color. Then click the magnifier or press the shortcut space. -You win the game if all heroes collected their mask and reached their home before the time end. +You win the game if all heroes have collected their mask and have reached their home before the time ends. To start a new game, simply reload the browser tab on all clients. ## 👉 Before Start - 1. Team up with 2-4 friends. Everybody opens the Game in the browser by its own: [🎮 RoguyIsleMaze](http://tobsefritz.de/java/roguy-isle-maze/) + 1. Team up with 2-4 friends. Everybody opens the game in the browser on their own: [🎮 RoguyIsleMaze](http://tobsefritz.de/java/roguy-isle-maze/) 2. Open the **help** dialog by clicking the question mark icon on the right side. It will also explain the controls! 3. Open the **settings** dialog by clicking the gear icon. Adjust _Number of Players_ to the number of total players of the game. Adjust _Player_ to your player number. Every teammate needs to choose a different one. Choose a _Network Game Channel_ and share it with your teammates, so everyone is in the same channel. - 4. Check your available actions. Depending on the number of player, and your chosen player you will have different + 4. Check your available actions. Depending on the number of players, and your chosen player you will have different actions available (green buttons next to the hero selection). > To get updates, you have to set up another player for everyone (every Browser). @@ -44,10 +43,10 @@ To start a new game, simply reload the browser tab on all clients. * +- Zoom the map in or out. ### 🐞 Troubleshooting -* All player need a different player, the correct number of players, and the same game channel. +* All players need a different _player-number_, the correct _number of players_, and the same _game channel_. Otherwise it's not possible for the game to sync the game states. Choose the channel wisely, because only - your team should use it. If also other players have chosen this channel, the will interact with your game. - Unfortunately, for now there is no possibility to see if a channel was already taken by others. + your team should use it. If other players have chosen this channel, they will interact with your game. + Unfortunately, for now there is no possibility to see if a channel is already taken by others. #### 🖼 Used Assets diff --git a/gradle.properties b/gradle.properties index a29c981..3014a6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -korgePluginVersion = 1.13.3.0 +korgePluginVersion = 1.13.8.3 org.gradle.jvmargs = -Xmx2g diff --git a/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/FaqComponent.kt b/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/FaqComponent.kt index f63a34d..4b7c1b8 100644 --- a/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/FaqComponent.kt +++ b/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/FaqComponent.kt @@ -2,22 +2,24 @@ package tfr.korge.jam.roguymaze.renderer import com.soywiz.klogger.Logger import com.soywiz.korge.input.onClick -import com.soywiz.korge.view.* +import com.soywiz.korge.view.Container +import com.soywiz.korge.view.Stage +import com.soywiz.korge.view.centerOn +import com.soywiz.korge.view.image import com.soywiz.korinject.AsyncInjector import tfr.korge.jam.roguymaze.OpenFaqEvent import tfr.korge.jam.roguymaze.lib.EventBus -import tfr.korge.jam.roguymaze.lib.Resolution import tfr.korge.jam.roguymaze.lib.Resources import tfr.korge.jam.roguymaze.model.World -class FaqComponent(val world: World, resolution: Resolution, val res: Resources, val rootView: View, val bus: EventBus) : Container() { +class FaqComponent(val world: World, val rootView: Stage, res: Resources, val bus: EventBus) : Container() { companion object { val log = Logger("FaqComponent") suspend operator fun invoke(injector: AsyncInjector): FaqComponent { injector.mapSingleton { - FaqComponent(get(), get(), get(), get(), get()) + FaqComponent(get(), get(), get(), get()) } return injector.get() } @@ -26,11 +28,11 @@ class FaqComponent(val world: World, resolution: Resolution, val res: Resources, init { val page1 = image(res.helpPage1) { - position((resolution.width - res.helpPage1.width) / 2, (resolution.height - res.helpPage1.height) / 2) + centerOn(rootView) visible = false } val page2 = image(res.helpPage2) { - position((resolution.width - res.helpPage2.width) / 2, (resolution.height - res.helpPage2.height) / 2) + centerOn(rootView) visible = false onClick { this@FaqComponent.visible = false diff --git a/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/SettingsComponent.kt b/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/SettingsComponent.kt index 0463512..5ecb010 100644 --- a/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/SettingsComponent.kt +++ b/src/commonMain/kotlin/tfr/korge/jam/roguymaze/renderer/SettingsComponent.kt @@ -10,33 +10,30 @@ import tfr.korge.jam.roguymaze.ChangePlayersCountEvent import tfr.korge.jam.roguymaze.ChangeRoomEvent import tfr.korge.jam.roguymaze.OpenSettingsEvent import tfr.korge.jam.roguymaze.lib.EventBus -import tfr.korge.jam.roguymaze.lib.Resolution import tfr.korge.jam.roguymaze.lib.Resources import tfr.korge.jam.roguymaze.model.World -class SettingsComponent(val world: World,resolution: Resolution, val res: Resources, val rootView: View, val bus: EventBus) : Container() { +class SettingsComponent(val world: World, val rootView: Stage, res: Resources, val bus: EventBus) : Container() { companion object { val log = Logger("SettingsComponent") suspend operator fun invoke(injector: AsyncInjector): SettingsComponent { injector.mapSingleton { - SettingsComponent(get(), get(), get(), get(), get()) + SettingsComponent(get(), get(), get(), get()) } return injector.get() } } - init { - bus.register { this.visible = !visible } val settings = image(res.table) { - position((resolution.width - res.table.width) / 2, (resolution.height - res.table.height) / 2) + centerOn(rootView) } @@ -48,7 +45,7 @@ class SettingsComponent(val world: World,resolution: Resolution, val res: Resou for (playerCount in 0 until 5) { uiText((playerCount + 1).toString(), width = 70.0) { alignTopToBottomOf(labelPlayers, 18.0) - alignLeftToLeftOf(labelPlayers, (90 * playerCount)) + alignLeftToLeftOf(labelPlayers, (90.0 * playerCount)) onClick { bus.send(ChangePlayersCountEvent(playerCount + 1)) } @@ -56,7 +53,7 @@ class SettingsComponent(val world: World,resolution: Resolution, val res: Resou } val labelPlayer = uiText("Player", width = 420.0) { - alignTopToBottomOf(labelPlayers, 100) + alignTopToBottomOf(labelPlayers, 100.0) alignLeftToLeftOf(labelPlayers) }