} // then the first collectable coin drops from one of ten random positions
else if (counter==0){
drop = gameRandom.rand(10);
- Sector::current()->add_object(new HeavyCoin(Vector (position.x+32*((drop<5)?-drop-1:drop-4),-32), Vector (0,0)));
+ Sector::current()->add_object(std::make_shared<HeavyCoin>(Vector (position.x+32*((drop<5)?-drop-1:drop-4),-32), Vector (0,0)));
counter++;
timer.start(DROP_TIME);
} // finally the remainder of the coins drop in a determined but appears to be a random order
if(counter<10){
drop += 7;
if(drop >= 10) drop -=10;
- Sector::current()->add_object(new HeavyCoin(Vector (position.x+32*((drop<5)?-drop-1:drop-4),-32), Vector (0,0)));
+ Sector::current()->add_object(std::make_shared<HeavyCoin>(Vector (position.x+32*((drop<5)?-drop-1:drop-4),-32), Vector (0,0)));
counter++;
timer.start(DROP_TIME);
}else{