Skip to content

Commit

Permalink
New Tux run animation (#2479)
Browse files Browse the repository at this point in the history
Tux walk animation alone doesn't look all that convincing at faster speeds so a run animation has been added.

The idea is that Tux starts moving with his walking animation until he reaches max speed. Once the walk animation has played its last frame when at max speed. Tux's run animation will start playing until he gets slower. Exception would be moments like the "level end sequence" or his main menu appearence where Tux should always play the walking animation due to the speed at which he walks in so instances.
  • Loading branch information
Rusty-Box authored Jul 12, 2023
1 parent bd6b0c9 commit 8fe630e
Show file tree
Hide file tree
Showing 22 changed files with 181 additions and 23 deletions.
Binary file added data/images/creatures/tux/big/run-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/big/run-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/creatures/tux/small/run-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
194 changes: 172 additions & 22 deletions data/images/creatures/tux/tux.sprite
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@

(action
(name "small-walk-right")
(fps 15.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 26 32 32)
(images "small/walk-0.png"
(images "small/walk_transition-0.png"
"small/walk-0.png"
"small/walk-1.png"
"small/walk-2.png"
"small/walk-3.png"
Expand All @@ -154,10 +156,33 @@

(action
(name "small-walk-left")
(fps 15.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 26 32 32)
(mirror-action "small-walk-right"))

(action
(name "small-run-right")
(fps 15.0)
(loop-frame 2)
(hitbox 18 26 32 32)
(images "small/run_transition-0.png"
"small/run-0.png"
"small/run-1.png"
"small/run-2.png"
"small/run-3.png"
"small/run-4.png"
"small/run-5.png"
"small/run-6.png"
"small/run-7.png"))

(action
(name "small-run-left")
(fps 15.0)
(loop-frame 2)
(hitbox 20 26 32 32)
(mirror-action "small-run-right"))

(action
(name "small-jump-right")
(fps 15.0)
Expand Down Expand Up @@ -604,9 +629,11 @@

(action
(name "big-walk-right")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(images "big/walk-0.png"
(images "big/walk_transition-0.png"
"big/walk-0.png"
"big/walk-1.png"
"big/walk-2.png"
"big/walk-3.png"
Expand All @@ -617,10 +644,33 @@

(action
(name "big-walk-left")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(mirror-action "big-walk-right"))

(action
(name "big-run-right")
(fps 15.0)
(loop-frame 2)
(hitbox 18 14 32 64)
(images "big/run_transition-0.png"
"big/run-0.png"
"big/run-1.png"
"big/run-2.png"
"big/run-3.png"
"big/run-4.png"
"big/run-5.png"
"big/run-6.png"
"big/run-7.png"))

(action
(name "big-run-left")
(fps 15.0)
(loop-frame 2)
(hitbox 20 14 32 64)
(mirror-action "big-run-right"))

(action
(name "big-jump-right")
(fps 15.0)
Expand Down Expand Up @@ -1075,9 +1125,11 @@

(action
(name "fire-walk-right")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(images "big/walk-0.png"
(images "big/walk_transition-0.png"
"big/walk-0.png"
"big/walk-1.png"
"big/walk-2.png"
"big/walk-3.png"
Expand All @@ -1088,11 +1140,34 @@

(action
(name "fire-walk-left")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(mirror-action "fire-walk-right"))

(action
(name "fire-run-right")
(fps 15.0)
(loop-frame 2)
(hitbox 18 14 32 64)
(images "big/run_transition-0.png"
"big/run-0.png"
"big/run-1.png"
"big/run-2.png"
"big/run-3.png"
"big/run-4.png"
"big/run-5.png"
"big/run-6.png"
"big/run-7.png"))

(action
(name "fire-run-left")
(fps 15.0)
(loop-frame 2)
(hitbox 20 14 32 64)
(mirror-action "fire-run-right"))

(action
(name "fire-jump-right")
(fps 15.0)
(loops 1)
Expand Down Expand Up @@ -1546,9 +1621,11 @@

(action
(name "ice-walk-right")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(images "big/walk-0.png"
(images "big/walk_transition-0.png"
"big/walk-0.png"
"big/walk-1.png"
"big/walk-2.png"
"big/walk-3.png"
Expand All @@ -1559,11 +1636,34 @@

(action
(name "ice-walk-left")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(mirror-action "ice-walk-right"))

(action
(name "ice-run-right")
(fps 15.0)
(loop-frame 2)
(hitbox 18 14 32 64)
(images "big/run_transition-0.png"
"big/run-0.png"
"big/run-1.png"
"big/run-2.png"
"big/run-3.png"
"big/run-4.png"
"big/run-5.png"
"big/run-6.png"
"big/run-7.png"))

(action
(name "ice-run-left")
(fps 15.0)
(loop-frame 2)
(hitbox 20 14 32 64)
(mirror-action "ice-run-right"))

(action
(name "ice-jump-right")
(fps 15.0)
(loops 1)
Expand Down Expand Up @@ -2017,9 +2117,11 @@

(action
(name "earth-walk-right")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(images "big/walk-0.png"
(images "big/walk_transition-0.png"
"big/walk-0.png"
"big/walk-1.png"
"big/walk-2.png"
"big/walk-3.png"
Expand All @@ -2030,11 +2132,34 @@

(action
(name "earth-walk-left")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(mirror-action "earth-walk-right"))

(action
(name "earth-run-right")
(fps 15.0)
(loop-frame 2)
(hitbox 18 14 32 64)
(images "big/run_transition-0.png"
"big/run-0.png"
"big/run-1.png"
"big/run-2.png"
"big/run-3.png"
"big/run-4.png"
"big/run-5.png"
"big/run-6.png"
"big/run-7.png"))

(action
(name "earth-run-left")
(fps 15.0)
(loop-frame 2)
(hitbox 20 14 32 64)
(mirror-action "earth-run-right"))

(action
(name "earth-jump-right")
(fps 15.0)
(loops 1)
Expand Down Expand Up @@ -2487,9 +2612,11 @@

(action
(name "air-walk-right")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(images "big/walk-0.png"
(images "big/walk_transition-0.png"
"big/walk-0.png"
"big/walk-1.png"
"big/walk-2.png"
"big/walk-3.png"
Expand All @@ -2500,11 +2627,34 @@

(action
(name "air-walk-left")
(fps 16.0)
(fps 14.0)
(loop-frame 2)
(hitbox 16 14 32 64)
(mirror-action "air-walk-right"))

(action
(name "air-run-right")
(fps 15.0)
(loop-frame 2)
(hitbox 18 14 32 64)
(images "big/run_transition-0.png"
"big/run-0.png"
"big/run-1.png"
"big/run-2.png"
"big/run-3.png"
"big/run-4.png"
"big/run-5.png"
"big/run-6.png"
"big/run-7.png"))

(action
(name "air-run-left")
(fps 15.0)
(loop-frame 2)
(hitbox 20 14 32 64)
(mirror-action "air-run-right"))

(action
(name "air-jump-right")
(fps 15.0)
(loops 1)
Expand Down Expand Up @@ -2903,8 +3053,8 @@
"cutscene/credits-0.png"))

(action
(name "credits-left")
(fps 10.0)
(hitbox 16 14 32 64)
(mirror-action "credits-right"))
(name "credits-left")
(fps 10.0)
(hitbox 16 14 32 64)
(mirror-action "credits-right"))
)
10 changes: 9 additions & 1 deletion src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2044,8 +2044,16 @@ Player::draw(DrawingContext& context)
m_sprite->set_action(sa_prefix+("-" + IDLE_STAGES[m_idle_stage])+sa_postfix, Sprite::LOOPS_CONTINUED);
}
}
else {
else
{
if (std::abs(m_physic.get_velocity_x()) >= MAX_RUN_XM-3)
{
m_sprite->set_action(sa_prefix+"-run"+sa_postfix);
}
else
{
m_sprite->set_action(sa_prefix+"-walk"+sa_postfix);
}
}
}

Expand Down

0 comments on commit 8fe630e

Please sign in to comment.