Replaced Ref and RefCounter with std::shared_ptr<>
[supertux.git] / src / object / coin_explode.cpp
index 35bca7d..bd73e07 100644 (file)
@@ -20,9 +20,8 @@
 #include "object/coin.hpp"
 #include "supertux/sector.hpp"
 
-CoinExplode::CoinExplode(const Vector& pos, const int vert) :
-  position(pos), 
-  y_velocity_weight(vert) // should generally be +/- 1 to send coins up or down respectively
+CoinExplode::CoinExplode(const Vector& pos) :
+  position(pos)
 {
 }
 
@@ -32,16 +31,16 @@ CoinExplode::update(float )
   int mag = 100; // madnitude that coins are to be thrown
   int rand = 30; // max variation to be subtracted from magnitide
 
-  Sector::current()->add_object(new HeavyCoin(position, Vector (2.5,-4.5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (2,-5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (1.5,-5.5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (1,-6)*(mag+gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (0.5,-6.5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (-2.5,-4.5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (-2,-5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (-1.5,-5.5)*(mag-gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (-1,-6)*(mag+gameRandom.rand(rand))));
-  Sector::current()->add_object(new HeavyCoin(position, Vector (-0.5,-6.5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (2.5,-4.5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (2,-5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (1.5,-5.5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (1,-6)*(mag+gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (0.5,-6.5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (-2.5,-4.5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (-2,-5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (-1.5,-5.5)*(mag-gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (-1,-6)*(mag+gameRandom.rand(rand))));
+  Sector::current()->add_object(std::make_shared<HeavyCoin>(position, Vector (-0.5,-6.5)*(mag-gameRandom.rand(rand))));
 
   remove_me();
 }