Open MYKIM95 opened 1 year ago
+1. @soywiz wondering what progress you've made on this issue?
Does it reproduce with KorGE 6.0.0-alpha9?
El mar, 9 jul 2024 a las 18:06, Gregory Mitchell @.***>) escribió:
+1. @soywiz https://github.com/soywiz wondering what progress you've made on this issue?
— Reply to this email directly, view it on GitHub https://github.com/korlibs/korge/issues/1156#issuecomment-2218098302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELLYHYJGUOC4ADW7H5RCTZLQDA3AVCNFSM6AAAAABKTFVMPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYGA4TQMZQGI . You are receiving this because you were mentioned.Message ID: @.***>
Does it reproduce with KorGE 6.0.0-alpha9? El mar, 9 jul 2024 a las 18:06, Gregory Mitchell @.>) escribió: … +1. @soywiz https://github.com/soywiz wondering what progress you've made on this issue? — Reply to this email directly, view it on GitHub <#1156 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELLYHYJGUOC4ADW7H5RCTZLQDA3AVCNFSM6AAAAABKTFVMPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYGA4TQMZQGI . You are receiving this because you were mentioned.Message ID: @.>
Yes.
kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelled}@2347a220
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: index: 1, size: 1
at korlibs.datastructure.FastArrayList.throwIndexOtOfBounds(FastArrayList.concurrent.kt:212)
at korlibs.datastructure.FastArrayList.get(FastArrayList.concurrent.kt:223)
at korlibs.korge.view.Container.getChildAt(Container.kt:167)
at korlibs.korge.view.Container.get(Container.kt:273)
at korlibs.korge.scene.TransitionView.getNext(Transition.kt:31)
at korlibs.korge.scene.TransitionView.startNewTransition(Transition.kt:39)
at korlibs.korge.scene.SceneContainer._changeTo-dWUq8MI(SceneContainer.kt:282)
at korlibs.korge.scene.SceneContainer._changeTo-1Y68eR8(SceneContainer.kt:522)
at korlibs.korge.scene.SceneContainer.pushTo-1Y68eR8(SceneContainer.kt:185)
at xyz.calcugames.combinatory.ui.scene.ControllerKt.levelSelect(controller.kt:60)
plugins {
id("com.soywiz.korge") version "6.0.0-alpha9"
}
Still Persistent in 6.0.0-beta1
.
Workaround:
Replace
injector.mapSingleton { MyScene() }
with
injector.mapPrototype { MyScene() }
@soywiz Does this help with identifying the issue?
Oh, I see. Scenes must use mapPrototype
and not mapSingleton
. By using mapSingleton
the same instance would be reused, and it is not designed to work like that. What we can do is to check that the instance is different when changing the scene or otherwise do nothing or report a warning or something about this.
Hello, I am trying to change scene when player's health goes to 0. I wrote my code as below to check player's health every 1 seconds, and if health goes to under 0, the scene will change to the end scene.
I got error log like below, and the scene does not changed. I/System.out: Changing scene to... class com.lok.dev.korgegame.scene.SceneEnd (Kotlin reflection is not available) ... com.lok.dev.korgegame.scene.SceneEnd@241a353 W/System.err: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelled}@d8e0189
If I use changeTo function without FixedUpdater and launch, it works well.