Skip to content

Commit

Permalink
Tweaks to HeavyCoin to make it placeable in the editor
Browse files Browse the repository at this point in the history
(just in case)
  • Loading branch information
LMH0013 committed Aug 13, 2013
1 parent 8d4aec8 commit ca395d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/object/coin.cpp
Expand Up @@ -26,7 +26,7 @@
#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(),
Expand Down Expand Up @@ -179,9 +179,19 @@ HeavyCoin::HeavyCoin(const Vector& pos, const Vector& init_velocity)
{
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)
{
Expand Down
1 change: 1 addition & 0 deletions src/object/coin.hpp
Expand Up @@ -48,6 +48,7 @@ class HeavyCoin : public Coin
{
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);
Expand Down
1 change: 1 addition & 0 deletions src/supertux/object_factory.cpp
Expand Up @@ -244,6 +244,7 @@ ObjectFactory::init_factories()
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");
Expand Down

0 comments on commit ca395d3

Please sign in to comment.