var jump just pressed

This commit is contained in:
minjaesong
2019-10-06 14:50:16 +09:00
parent 02b67de91a
commit 951d9e0e71
3 changed files with 98 additions and 2 deletions

View File

@@ -166,6 +166,7 @@ open class ActorHumanoid(
protected inline val isGamer: Boolean
get() = if (Terrarum.ingame == null) false else this == Terrarum.ingame!!.actorNowPlaying
private var jumpJustPressedLatched = false
@Transient private val nullItem = object : GameItem(0) {
override val isUnique: Boolean = false
@@ -248,7 +249,17 @@ open class ActorHumanoid(
gamepad.getButton(AppLoader.getConfigInt("gamepadltrigger"))
}
TODO("isJumpJustDown")
if (isJumpJustDown && jumpJustPressedLatched) {
isJumpJustDown = false
}
else if (isJumpDown && !jumpJustPressedLatched) {
isJumpJustDown = true
jumpJustPressedLatched = true
}
else if (!isJumpDown) {
jumpJustPressedLatched = false
}
}
else {
isUpDown = axisY < 0f

View File

@@ -133,7 +133,8 @@ class BasicDebugInfoWindow : UICanvas() {
"${if (player.walledRight) "$ccR" else "$ccG"}R" +
"${if (player.colliding) "$ccR" else "$ccG"}${0x08.toChar()} " +
"${if (player.jumping) "$ccG" else "$ccK"}JMP" +
"${if (player.isJumpDown) "$ccG" else "$ccK"}KEY"
"${if (player.isJumpDown) "$ccG" else "$ccK"}KEY" +
"${if (player.isJumpJustDown) "$ccO" else "$ccK"}${0x0F.toChar()}"
)
}