Keyboard strobing moved to a new thread so that fast typing is possible even if the game's update method is running slowly

This commit is contained in:
minjaesong
2021-11-06 11:30:42 +09:00
parent ddd7492922
commit 7503876d1f
15 changed files with 240 additions and 131 deletions

View File

@@ -8,6 +8,7 @@ import net.torvald.terrarum.gameactors.Actor
import net.torvald.terrarum.gameactors.ActorID
import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gameactors.BlockMarkerActor
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
import net.torvald.terrarum.gameitem.ItemID
import net.torvald.terrarum.gameworld.GameWorld
import net.torvald.terrarum.modulebasegame.IngameRenderer
@@ -31,7 +32,7 @@ import java.util.concurrent.locks.Lock
* Although the game (as product) can have infinitely many stages/planets/etc., those stages must be manually managed by YOU;
* this instance only stores the stage that is currently being used.
*/
open class IngameInstance(val batch: SpriteBatch, val isMultiplayer: Boolean = false) : Screen {
open class IngameInstance(val batch: SpriteBatch, val isMultiplayer: Boolean = false) : TerrarumGamescreen {
open protected val actorMBRConverter = object : MBRConverter<ActorWithBody> {
override fun getDimensions(): Int = 2
@@ -134,6 +135,9 @@ open class IngameInstance(val batch: SpriteBatch, val isMultiplayer: Boolean = f
override fun hide() {
}
override fun inputStrobed(e: TerrarumKeyboardEvent) {
}
override fun show() {
// the very basic show() implementation