A more elegant approach to backflip animation.
authorLMH <lmh.0013@gmail.com>
Sat, 8 Mar 2014 20:46:57 +0000 (10:46 -1000)
committerLMH <lmh.0013@gmail.com>
Sat, 8 Mar 2014 22:16:06 +0000 (12:16 -1000)
Backflip no longer uses several images that have been previously rotated, instead a single image is used and the sprite is rotated.

33 files changed:
WHATSNEW.txt
data/images/creatures/tux/big/backflip-0.png [deleted file]
data/images/creatures/tux/big/backflip-1.png [deleted file]
data/images/creatures/tux/big/backflip-2.png [deleted file]
data/images/creatures/tux/big/backflip-3.png [deleted file]
data/images/creatures/tux/big/backflip-4.png [deleted file]
data/images/creatures/tux/big/backflip-5.png [deleted file]
data/images/creatures/tux/big/backflip-6.png [deleted file]
data/images/creatures/tux/big/backflip-7.png [deleted file]
data/images/creatures/tux/big/backflip-8.png [deleted file]
data/images/creatures/tux/big/backflip.png [new file with mode: 0644]
data/images/creatures/tux/fire/backflip-0.png [deleted file]
data/images/creatures/tux/fire/backflip-1.png [deleted file]
data/images/creatures/tux/fire/backflip-2.png [deleted file]
data/images/creatures/tux/fire/backflip-3.png [deleted file]
data/images/creatures/tux/fire/backflip-4.png [deleted file]
data/images/creatures/tux/fire/backflip-5.png [deleted file]
data/images/creatures/tux/fire/backflip-6.png [deleted file]
data/images/creatures/tux/fire/backflip-7.png [deleted file]
data/images/creatures/tux/fire/backflip-8.png [deleted file]
data/images/creatures/tux/fire/backflip.png [new file with mode: 0644]
data/images/creatures/tux/ice/backflip-0.png [deleted file]
data/images/creatures/tux/ice/backflip-1.png [deleted file]
data/images/creatures/tux/ice/backflip-2.png [deleted file]
data/images/creatures/tux/ice/backflip-3.png [deleted file]
data/images/creatures/tux/ice/backflip-4.png [deleted file]
data/images/creatures/tux/ice/backflip-5.png [deleted file]
data/images/creatures/tux/ice/backflip-6.png [deleted file]
data/images/creatures/tux/ice/backflip-7.png [deleted file]
data/images/creatures/tux/ice/backflip-8.png [deleted file]
data/images/creatures/tux/ice/backflip.png [new file with mode: 0644]
data/images/creatures/tux/tux.sprite
src/object/player.cpp

index 26dee86..0ba7ff4 100644 (file)
@@ -6,6 +6,10 @@ glow effects
 new badguys: iceflame, ghostflame, livefire, goldbomb, smartblock
 new bonuses: coinrain, coinexplode
 statistics improved
+icy island levels tweaked
+new sounds
+massive improvements to localization
+efficiency tweaks
 
 Supertux Release 0.3.4 (2013-07)
 --------------------------------
diff --git a/data/images/creatures/tux/big/backflip-0.png b/data/images/creatures/tux/big/backflip-0.png
deleted file mode 100644 (file)
index ea1a120..0000000
Binary files a/data/images/creatures/tux/big/backflip-0.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-1.png b/data/images/creatures/tux/big/backflip-1.png
deleted file mode 100644 (file)
index f407f14..0000000
Binary files a/data/images/creatures/tux/big/backflip-1.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-2.png b/data/images/creatures/tux/big/backflip-2.png
deleted file mode 100644 (file)
index cdb74c4..0000000
Binary files a/data/images/creatures/tux/big/backflip-2.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-3.png b/data/images/creatures/tux/big/backflip-3.png
deleted file mode 100644 (file)
index 136eeb0..0000000
Binary files a/data/images/creatures/tux/big/backflip-3.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-4.png b/data/images/creatures/tux/big/backflip-4.png
deleted file mode 100644 (file)
index d8953ff..0000000
Binary files a/data/images/creatures/tux/big/backflip-4.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-5.png b/data/images/creatures/tux/big/backflip-5.png
deleted file mode 100644 (file)
index c45c115..0000000
Binary files a/data/images/creatures/tux/big/backflip-5.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-6.png b/data/images/creatures/tux/big/backflip-6.png
deleted file mode 100644 (file)
index a727112..0000000
Binary files a/data/images/creatures/tux/big/backflip-6.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-7.png b/data/images/creatures/tux/big/backflip-7.png
deleted file mode 100644 (file)
index 0350542..0000000
Binary files a/data/images/creatures/tux/big/backflip-7.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip-8.png b/data/images/creatures/tux/big/backflip-8.png
deleted file mode 100644 (file)
index ea1a120..0000000
Binary files a/data/images/creatures/tux/big/backflip-8.png and /dev/null differ
diff --git a/data/images/creatures/tux/big/backflip.png b/data/images/creatures/tux/big/backflip.png
new file mode 100644 (file)
index 0000000..ea1a120
Binary files /dev/null and b/data/images/creatures/tux/big/backflip.png differ
diff --git a/data/images/creatures/tux/fire/backflip-0.png b/data/images/creatures/tux/fire/backflip-0.png
deleted file mode 100644 (file)
index ac15e10..0000000
Binary files a/data/images/creatures/tux/fire/backflip-0.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-1.png b/data/images/creatures/tux/fire/backflip-1.png
deleted file mode 100644 (file)
index 8ed77dd..0000000
Binary files a/data/images/creatures/tux/fire/backflip-1.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-2.png b/data/images/creatures/tux/fire/backflip-2.png
deleted file mode 100644 (file)
index 82ea690..0000000
Binary files a/data/images/creatures/tux/fire/backflip-2.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-3.png b/data/images/creatures/tux/fire/backflip-3.png
deleted file mode 100644 (file)
index 2f09dfe..0000000
Binary files a/data/images/creatures/tux/fire/backflip-3.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-4.png b/data/images/creatures/tux/fire/backflip-4.png
deleted file mode 100644 (file)
index 59c868b..0000000
Binary files a/data/images/creatures/tux/fire/backflip-4.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-5.png b/data/images/creatures/tux/fire/backflip-5.png
deleted file mode 100644 (file)
index d822b9f..0000000
Binary files a/data/images/creatures/tux/fire/backflip-5.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-6.png b/data/images/creatures/tux/fire/backflip-6.png
deleted file mode 100644 (file)
index 43c5bfc..0000000
Binary files a/data/images/creatures/tux/fire/backflip-6.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-7.png b/data/images/creatures/tux/fire/backflip-7.png
deleted file mode 100644 (file)
index eecb3bd..0000000
Binary files a/data/images/creatures/tux/fire/backflip-7.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip-8.png b/data/images/creatures/tux/fire/backflip-8.png
deleted file mode 100644 (file)
index ac15e10..0000000
Binary files a/data/images/creatures/tux/fire/backflip-8.png and /dev/null differ
diff --git a/data/images/creatures/tux/fire/backflip.png b/data/images/creatures/tux/fire/backflip.png
new file mode 100644 (file)
index 0000000..ac15e10
Binary files /dev/null and b/data/images/creatures/tux/fire/backflip.png differ
diff --git a/data/images/creatures/tux/ice/backflip-0.png b/data/images/creatures/tux/ice/backflip-0.png
deleted file mode 100644 (file)
index 5995630..0000000
Binary files a/data/images/creatures/tux/ice/backflip-0.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-1.png b/data/images/creatures/tux/ice/backflip-1.png
deleted file mode 100644 (file)
index 7e2800d..0000000
Binary files a/data/images/creatures/tux/ice/backflip-1.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-2.png b/data/images/creatures/tux/ice/backflip-2.png
deleted file mode 100644 (file)
index 423df4e..0000000
Binary files a/data/images/creatures/tux/ice/backflip-2.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-3.png b/data/images/creatures/tux/ice/backflip-3.png
deleted file mode 100644 (file)
index 2f3119c..0000000
Binary files a/data/images/creatures/tux/ice/backflip-3.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-4.png b/data/images/creatures/tux/ice/backflip-4.png
deleted file mode 100644 (file)
index abeca32..0000000
Binary files a/data/images/creatures/tux/ice/backflip-4.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-5.png b/data/images/creatures/tux/ice/backflip-5.png
deleted file mode 100644 (file)
index e173247..0000000
Binary files a/data/images/creatures/tux/ice/backflip-5.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-6.png b/data/images/creatures/tux/ice/backflip-6.png
deleted file mode 100644 (file)
index 8070458..0000000
Binary files a/data/images/creatures/tux/ice/backflip-6.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-7.png b/data/images/creatures/tux/ice/backflip-7.png
deleted file mode 100644 (file)
index 08c268d..0000000
Binary files a/data/images/creatures/tux/ice/backflip-7.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip-8.png b/data/images/creatures/tux/ice/backflip-8.png
deleted file mode 100644 (file)
index 5995630..0000000
Binary files a/data/images/creatures/tux/ice/backflip-8.png and /dev/null differ
diff --git a/data/images/creatures/tux/ice/backflip.png b/data/images/creatures/tux/ice/backflip.png
new file mode 100644 (file)
index 0000000..5995630
Binary files /dev/null and b/data/images/creatures/tux/ice/backflip.png differ
index 3ca2135..0f154ba 100644 (file)
        (action
          (name "big-backflip-right")
          (hitbox 16 37 32 32)
-         (fps 18.0)
-         (images "big/backflip-0.png"
-                 "big/backflip-1.png"
-                 "big/backflip-2.png"
-                 "big/backflip-3.png"
-                 "big/backflip-4.png"
-                 "big/backflip-5.png"
-                 "big/backflip-6.png"
-                 "big/backflip-7.png"
-                 "big/backflip-8.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"
-                 "big/backflip-0.png"))
+         (images "big/backflip.png"))
 
        (action
          (name "big-backflip-left")
        (action
          (name "fire-backflip-right")
          (hitbox 16 37 32 32)
-         (fps 18.0)
-         (images "fire/backflip-0.png"
-                 "fire/backflip-1.png"
-                 "fire/backflip-2.png"
-                 "fire/backflip-3.png"
-                 "fire/backflip-4.png"
-                 "fire/backflip-5.png"
-                 "fire/backflip-6.png"
-                 "fire/backflip-7.png"
-                 "fire/backflip-8.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"
-                 "fire/backflip-0.png"))
+         (images "fire/backflip.png"))
 
        (action
          (name "fire-backflip-left")
        (action
          (name "ice-backflip-right")
          (hitbox 16 37 32 32)
-         (fps 18.0)
-         (images "ice/backflip-0.png"
-                 "ice/backflip-1.png"
-                 "ice/backflip-2.png"
-                 "ice/backflip-3.png"
-                 "ice/backflip-4.png"
-                 "ice/backflip-5.png"
-                 "ice/backflip-6.png"
-                 "ice/backflip-7.png"
-                 "ice/backflip-8.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"
-                 "ice/backflip-0.png"))
+         (images "ice/backflip.png"))
 
        (action
          (name "ice-backflip-left")
index a408975..2cc156e 100644 (file)
@@ -213,6 +213,7 @@ Player::init()
   deactivated = false;
   backflipping = false;
   backflip_direction = 0;
+  sprite->set_angle(0.0f);
   visible = true;
   swimming = false;
   on_ice = false;
@@ -323,6 +324,7 @@ Player::trigger_sequence(std::string sequence_name)
   if (climbing) stop_climbing(*climbing);
   backflipping = false;
   backflip_direction = 0;
+  sprite->set_angle(0.0f);
   GameSession::current()->start_sequence(sequence_name);
 }
 
@@ -369,6 +371,8 @@ Player::update(float elapsed_time)
     //prevent player from changing direction when backflipping
     dir = (backflip_direction == 1) ? LEFT : RIGHT;
     if (backflip_timer.started()) physic.set_velocity_x(100 * backflip_direction);
+    //rotate sprite during flip
+    sprite->set_angle(sprite->get_angle() + (dir==LEFT?1:-1) * elapsed_time * (360.0f / 0.5f));
   }
 
   // set fall mode...
@@ -388,6 +392,7 @@ Player::update(float elapsed_time)
     if (backflipping && (backflip_timer.get_timegone() > 0.15f)) {
       backflipping = false;
       backflip_direction = 0;
+      sprite->set_angle(0.0f);
 
       // if controls are currently deactivated, we take care of standing up ourselves
       if (deactivated)
@@ -835,6 +840,7 @@ Player::handle_input()
   if( backflipping && ( !controller->hold(Controller::JUMP) && !backflip_timer.started()) ){
     backflipping = false;
     backflip_direction = 0;
+    sprite->set_angle(0.0f);
   }
 }
 
@@ -1309,6 +1315,7 @@ Player::kill(bool completely)
       adjust_height(SMALL_TUX_HEIGHT);
       duck = false;
       backflipping = false;
+      sprite->set_angle(0.0f);
       set_bonus(NO_BONUS, true);
     } else if(player_status->bonus == NO_BONUS) {
       safe_timer.start(TUX_SAFE_TIME);
@@ -1368,6 +1375,7 @@ Player::move(const Vector& vector)
     set_size(TUX_WIDTH, SMALL_TUX_HEIGHT);
   duck = false;
   backflipping = false;
+  sprite->set_angle(0.0f);
   last_ground_y = vector.y;
   if (climbing) stop_climbing(*climbing);
 
@@ -1498,6 +1506,7 @@ Player::start_climbing(Climbable& climbable)
   if (backflipping) {
     backflipping = false;
     backflip_direction = 0;
+    sprite->set_angle(0.0f);
   }
 }