Skip to content

Commit

Permalink
fix some anims
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Khar committed Dec 4, 2023
1 parent 9286c1f commit 070bf1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,8 @@ class GouramiEntity(entityType: EntityType<out GouramiEntity>, world: World) :
}
}

override fun <E : GeoAnimatable> predicate(event: AnimationState<E>): PlayState {
if (isSubmergedInWater) {
event.controller.setAnimation(RawAnimation.begin().then("swim", Animation.LoopType.LOOP))
return PlayState.CONTINUE
}
if (!isSubmergedInWater) {
event.controller.setAnimation(RawAnimation.begin().then("flop", Animation.LoopType.LOOP))
return PlayState.CONTINUE
}
if (isWet && isFallFlying) {
event.controller.setAnimation(RawAnimation.begin().then("swim", Animation.LoopType.LOOP))
return PlayState.CONTINUE
}
return PlayState.STOP
override fun shouldFlopOnLand(): Boolean {
return true
}

override fun getMaxSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ open class HybridAquaticFishEntity(
if (isSubmergedInWater) {
event.controller.setAnimation(SWIM_ANIMATION)
return PlayState.CONTINUE
}
if (!isSubmergedInWater && shouldFlopOnLand()) {
} else if (shouldFlopOnLand()) {
event.controller.setAnimation(FLOP_ANIMATION)
return PlayState.CONTINUE
}

if (isWet && isFallFlying) {
event.controller.setAnimation(SWIM_ANIMATION)
return PlayState.CONTINUE
Expand Down

0 comments on commit 070bf1e

Please sign in to comment.