#include "supertux/sector.hpp"
Coin::Coin(const Vector& pos)
- : MovingSprite(pos, "images/objects/coin/coin.sprite", LAYER_TILES, COLGROUP_MOVING),
+ : MovingSprite(pos, "images/objects/coin/coin.sprite", LAYER_TILES, COLGROUP_TOUCHABLE),
path(),
walker(),
offset(),
{
physic.enable_gravity(true);
sound_manager->preload("sounds/coin.wav");
+ set_group(COLGROUP_MOVING);
physic.set_velocity(init_velocity);
}
+HeavyCoin::HeavyCoin(const Reader& reader)
+ : Coin(reader),
+ physic()
+{
+ physic.enable_gravity(true);
+ sound_manager->preload("sounds/coin.wav");
+ set_group(COLGROUP_MOVING);
+}
+
void
HeavyCoin::update(float elapsed_time)
{
{
public:
HeavyCoin(const Vector& pos, const Vector& init_velocity);
+ HeavyCoin(const Reader& reader);
virtual void update(float elapsed_time);
virtual void collision_solid(const CollisionHit& hit);
add_factory<Explosion>("explosion");
add_factory<Firefly>("firefly");
add_factory<Gradient>("gradient");
+ add_factory<HeavyCoin>("heavycoin");
add_factory<HurtingPlatform>("hurting_platform");
add_factory<IceCrusher>("icecrusher");
add_factory<InfoBlock>("infoblock");