Set default behavior for red potion powerups to flip level
authorLMH <lmh.0013@gmail.com>
Tue, 13 Aug 2013 23:51:23 +0000 (13:51 -1000)
committerLMH <lmh.0013@gmail.com>
Tue, 13 Aug 2013 23:54:45 +0000 (13:54 -1000)
src/object/powerup.cpp

index a70560f..927001b 100644 (file)
@@ -17,6 +17,7 @@
 #include "audio/sound_manager.hpp"
 #include "object/player.hpp"
 #include "object/powerup.hpp"
+#include "scripting/level.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/sector.hpp"
 #include "sprite/sprite.hpp"
@@ -96,6 +97,8 @@ PowerUp::collision(GameObject& other, const CollisionHit&)
     player->make_invincible();
   } else if (sprite_name == "images/powerups/1up/1up.sprite") {
     player->get_status()->add_coins(100);
+  } else if (sprite_name == "images/powerups/potions/red-potion.sprite") {
+    scripting::Level_flip_vertically();
   }
 
   remove_me();