From: Tobias Markus Date: Tue, 17 Dec 2013 14:52:54 +0000 (+0100) Subject: WIP improvement: Egg powerup rotation X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0bf0ca21512137dbcfb24d1788a518cab12f8df0;p=supertux.git WIP improvement: Egg powerup rotation --- diff --git a/data/images/powerups/egg/egg-0.png b/data/images/powerups/egg/egg-0.png new file mode 100644 index 000000000..6f63e35c6 Binary files /dev/null and b/data/images/powerups/egg/egg-0.png differ diff --git a/data/images/powerups/egg/egg-1.png b/data/images/powerups/egg/egg-1.png new file mode 100644 index 000000000..863b78b81 Binary files /dev/null and b/data/images/powerups/egg/egg-1.png differ diff --git a/data/images/powerups/egg/egg-10.png b/data/images/powerups/egg/egg-10.png new file mode 100644 index 000000000..cb804d733 Binary files /dev/null and b/data/images/powerups/egg/egg-10.png differ diff --git a/data/images/powerups/egg/egg-11.png b/data/images/powerups/egg/egg-11.png new file mode 100644 index 000000000..9e326b2d0 Binary files /dev/null and b/data/images/powerups/egg/egg-11.png differ diff --git a/data/images/powerups/egg/egg-12.png b/data/images/powerups/egg/egg-12.png new file mode 100644 index 000000000..1ee1f18dd Binary files /dev/null and b/data/images/powerups/egg/egg-12.png differ diff --git a/data/images/powerups/egg/egg-13.png b/data/images/powerups/egg/egg-13.png new file mode 100644 index 000000000..2b5e0a53b Binary files /dev/null and b/data/images/powerups/egg/egg-13.png differ diff --git a/data/images/powerups/egg/egg-14.png b/data/images/powerups/egg/egg-14.png new file mode 100644 index 000000000..707fc97d0 Binary files /dev/null and b/data/images/powerups/egg/egg-14.png differ diff --git a/data/images/powerups/egg/egg-15.png b/data/images/powerups/egg/egg-15.png new file mode 100644 index 000000000..37266c8b0 Binary files /dev/null and b/data/images/powerups/egg/egg-15.png differ diff --git a/data/images/powerups/egg/egg-16.png b/data/images/powerups/egg/egg-16.png new file mode 100644 index 000000000..9e24d1c10 Binary files /dev/null and b/data/images/powerups/egg/egg-16.png differ diff --git a/data/images/powerups/egg/egg-17.png b/data/images/powerups/egg/egg-17.png new file mode 100644 index 000000000..a6193d40a Binary files /dev/null and b/data/images/powerups/egg/egg-17.png differ diff --git a/data/images/powerups/egg/egg-18.png b/data/images/powerups/egg/egg-18.png new file mode 100644 index 000000000..e0641398b Binary files /dev/null and b/data/images/powerups/egg/egg-18.png differ diff --git a/data/images/powerups/egg/egg-19.png b/data/images/powerups/egg/egg-19.png new file mode 100644 index 000000000..cd2e385a3 Binary files /dev/null and b/data/images/powerups/egg/egg-19.png differ diff --git a/data/images/powerups/egg/egg-2.png b/data/images/powerups/egg/egg-2.png new file mode 100644 index 000000000..ed6b220cf Binary files /dev/null and b/data/images/powerups/egg/egg-2.png differ diff --git a/data/images/powerups/egg/egg-3.png b/data/images/powerups/egg/egg-3.png new file mode 100644 index 000000000..e0f4bbb02 Binary files /dev/null and b/data/images/powerups/egg/egg-3.png differ diff --git a/data/images/powerups/egg/egg-4.png b/data/images/powerups/egg/egg-4.png new file mode 100644 index 000000000..e041ad7cd Binary files /dev/null and b/data/images/powerups/egg/egg-4.png differ diff --git a/data/images/powerups/egg/egg-5.png b/data/images/powerups/egg/egg-5.png new file mode 100644 index 000000000..0fc79ce6e Binary files /dev/null and b/data/images/powerups/egg/egg-5.png differ diff --git a/data/images/powerups/egg/egg-6.png b/data/images/powerups/egg/egg-6.png new file mode 100644 index 000000000..fd2bfb349 Binary files /dev/null and b/data/images/powerups/egg/egg-6.png differ diff --git a/data/images/powerups/egg/egg-7.png b/data/images/powerups/egg/egg-7.png new file mode 100644 index 000000000..d9426abcf Binary files /dev/null and b/data/images/powerups/egg/egg-7.png differ diff --git a/data/images/powerups/egg/egg-8.png b/data/images/powerups/egg/egg-8.png new file mode 100644 index 000000000..9a7fc19cf Binary files /dev/null and b/data/images/powerups/egg/egg-8.png differ diff --git a/data/images/powerups/egg/egg-9.png b/data/images/powerups/egg/egg-9.png new file mode 100644 index 000000000..ff38eafd1 Binary files /dev/null and b/data/images/powerups/egg/egg-9.png differ diff --git a/data/images/powerups/egg/egg.png b/data/images/powerups/egg/egg.png deleted file mode 100644 index 6f63e35c6..000000000 Binary files a/data/images/powerups/egg/egg.png and /dev/null differ diff --git a/data/images/powerups/egg/egg.sprite b/data/images/powerups/egg/egg.sprite index 899b94899..7e337a8d1 100644 --- a/data/images/powerups/egg/egg.sprite +++ b/data/images/powerups/egg/egg.sprite @@ -1,4 +1,31 @@ (supertux-sprite (action - (name "default") - (images "egg.png"))) + (name "right") + (images "egg-0.png" + "egg-1.png" + "egg-2.png" + "egg-3.png" + "egg-4.png" + "egg-5.png" + "egg-6.png" + "egg-7.png" + "egg-8.png" + "egg-9.png" + "egg-10.png" + "egg-11.png" + "egg-12.png" + "egg-13.png" + "egg-14.png" + "egg-16.png" + "egg-17.png" + "egg-18.png" + ) + (fps 25) + ) + (action + (name "left") + (mirror-action "right") + (fps 25) + ) +) + diff --git a/src/object/growup.cpp b/src/object/growup.cpp index 19be5350b..1bc7fcc3b 100644 --- a/src/object/growup.cpp +++ b/src/object/growup.cpp @@ -32,6 +32,8 @@ GrowUp::GrowUp(Direction direction) : //set light for glow effect lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.2f, 0.2f, 0.0f)); + + sprite->set_action((direction == LEFT) ? "left" : "right"); } void @@ -61,8 +63,15 @@ GrowUp::collision_solid(const CollisionHit& hit) physic.set_velocity_y(0); if(hit.bottom && physic.get_velocity_y() > 0) physic.set_velocity_y(0); - if(hit.left || hit.right) + if(hit.left || hit.right) { physic.set_velocity_x(-physic.get_velocity_x()); + if(hit.left) + sprite->set_action("right"); + else { + sprite->set_action("left"); + } + + } } HitResponse