WIP improvement: Egg powerup rotation
authorTobias Markus <tobbi@mozilla-uk.org>
Tue, 17 Dec 2013 14:52:54 +0000 (15:52 +0100)
committerTobias Markus <tobiasmarkus1@tobiass-mbp.fritz.box>
Fri, 24 Jan 2014 21:56:58 +0000 (22:56 +0100)
23 files changed:
data/images/powerups/egg/egg-0.png [new file with mode: 0644]
data/images/powerups/egg/egg-1.png [new file with mode: 0644]
data/images/powerups/egg/egg-10.png [new file with mode: 0644]
data/images/powerups/egg/egg-11.png [new file with mode: 0644]
data/images/powerups/egg/egg-12.png [new file with mode: 0644]
data/images/powerups/egg/egg-13.png [new file with mode: 0644]
data/images/powerups/egg/egg-14.png [new file with mode: 0644]
data/images/powerups/egg/egg-15.png [new file with mode: 0644]
data/images/powerups/egg/egg-16.png [new file with mode: 0644]
data/images/powerups/egg/egg-17.png [new file with mode: 0644]
data/images/powerups/egg/egg-18.png [new file with mode: 0644]
data/images/powerups/egg/egg-19.png [new file with mode: 0644]
data/images/powerups/egg/egg-2.png [new file with mode: 0644]
data/images/powerups/egg/egg-3.png [new file with mode: 0644]
data/images/powerups/egg/egg-4.png [new file with mode: 0644]
data/images/powerups/egg/egg-5.png [new file with mode: 0644]
data/images/powerups/egg/egg-6.png [new file with mode: 0644]
data/images/powerups/egg/egg-7.png [new file with mode: 0644]
data/images/powerups/egg/egg-8.png [new file with mode: 0644]
data/images/powerups/egg/egg-9.png [new file with mode: 0644]
data/images/powerups/egg/egg.png [deleted file]
data/images/powerups/egg/egg.sprite
src/object/growup.cpp

diff --git a/data/images/powerups/egg/egg-0.png b/data/images/powerups/egg/egg-0.png
new file mode 100644 (file)
index 0000000..6f63e35
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 (file)
index 0000000..863b78b
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 (file)
index 0000000..cb804d7
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 (file)
index 0000000..9e326b2
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 (file)
index 0000000..1ee1f18
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 (file)
index 0000000..2b5e0a5
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 (file)
index 0000000..707fc97
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 (file)
index 0000000..37266c8
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 (file)
index 0000000..9e24d1c
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 (file)
index 0000000..a6193d4
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 (file)
index 0000000..e064139
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 (file)
index 0000000..cd2e385
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 (file)
index 0000000..ed6b220
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 (file)
index 0000000..e0f4bbb
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 (file)
index 0000000..e041ad7
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 (file)
index 0000000..0fc79ce
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 (file)
index 0000000..fd2bfb3
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 (file)
index 0000000..d9426ab
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 (file)
index 0000000..9a7fc19
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 (file)
index 0000000..ff38eaf
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 (file)
index 6f63e35..0000000
Binary files a/data/images/powerups/egg/egg.png and /dev/null differ
index 899b948..7e337a8 100644 (file)
@@ -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)
+       )        
+)
+
index 19be535..1bc7fcc 100644 (file)
@@ -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