summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e1a084)
raw | patch | inline | side by side (parent: 9e1a084)
author | fredboy <fredboy@protonmail.com> | |
Mon, 15 Apr 2024 16:57:55 +0000 (23:57 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Mon, 15 Apr 2024 17:10:20 +0000 (00:10 +0700) |
core/src/ru/deadsoftware/cavedroid/game/mobs/Player.java | patch | blob | history |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/Player.java b/core/src/ru/deadsoftware/cavedroid/game/mobs/Player.java
index 5ea56d9bf8c9b30cbf1d72254b02497473fe8f57..3335b7f5ebc69322478b8e1eeb7cf82f043b2baa 100644 (file)
Assets.playerSprite[0][3].setRotation(-mAnim);
Assets.playerSprite[1][3].setRotation(mAnim);
- if (mAnim >= 60 || mAnim <= -60 ||(mVelocity.x == 0f && isAnimationIncreasing())) {
+ if (mAnim > 60f) {
+ mAnim = 60f;
+ mAnimDelta = -ANIMATION_SPEED;
+ } else if (mAnim < -60f) {
+ mAnim = -60f;
+ mAnimDelta = ANIMATION_SPEED;
+ }
+
+ if (mVelocity.x == 0f && isAnimationIncreasing()) {
mAnimDelta = -mAnimDelta;
}