Skip to content

Commit

Permalink
added ease in animator to player animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ColstonBod-oy committed Mar 24, 2024
1 parent 4a2ca97 commit 39eede0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/commonMain/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import korlibs.image.color.*
import korlibs.image.format.*
import korlibs.io.file.std.*
import korlibs.korge.*
import korlibs.korge.animate.*
import korlibs.korge.dragonbones.*
import korlibs.korge.input.*
import korlibs.korge.mascots.*
Expand Down Expand Up @@ -145,7 +146,14 @@ class MyScene : Scene() {
fun setState(name: String, time: TimeSpan) {
if (playerState != name) {
playerState = name
player.animation = name

animator {
tween(time = time, easing = Easing.EASE_IN)
block {
player.animation = name
}
}

player.play()
}
}
Expand Down

0 comments on commit 39eede0

Please sign in to comment.