Skip to content

Commit

Permalink
⬆ Update to latest KorGE
Browse files Browse the repository at this point in the history
  • Loading branch information
TobseF committed Jun 22, 2020
1 parent a01f892 commit 2905d40
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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).
Expand All @@ -44,10 +43,10 @@ To start a new game, simply reload the browser tab on all clients.
* <kbd>+</kbd><kbd>-</kbd> 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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
korgePluginVersion = 1.13.3.0
korgePluginVersion = 1.13.8.3
org.gradle.jvmargs = -Xmx2g
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<OpenSettingsEvent> {
this.visible = !visible
}

val settings = image(res.table) {
position((resolution.width - res.table.width) / 2, (resolution.height - res.table.height) / 2)
centerOn(rootView)
}


Expand All @@ -48,15 +45,15 @@ 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))
}
}
}

val labelPlayer = uiText("Player", width = 420.0) {
alignTopToBottomOf(labelPlayers, 100)
alignTopToBottomOf(labelPlayers, 100.0)
alignLeftToLeftOf(labelPlayers)
}

Expand Down

0 comments on commit 2905d40

Please sign in to comment.