;; src/tile.cpp, unisolid is 3 not 2
(supertux-tiles
(tile
+ (id 2946)
+ (images
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-4.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ )
+ (solid #t)
+ (fullbox #t)
+ (next-tile 84)
+ (editor-images "objects/bonus_block/bonus-rock.png")
+ (data 9)
+ (fps 15)
+ )
+
+ (tile
+ (id 2945)
+ (images
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-4.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ )
+ (solid #t)
+ (fullbox #t)
+ (next-tile 84)
+ (editor-images "objects/bonus_block/bonus-porttramp.png")
+ (data 8)
+ (fps 15)
+ )
+
+ (tile
+ (id 2944)
+ (images
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-4.png"
+ "objects/bonus_block/full-3.png"
+ "objects/bonus_block/full-2.png"
+ "objects/bonus_block/full-1.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ "objects/bonus_block/full-0.png"
+ )
+ (solid #t)
+ (fullbox #t)
+ (next-tile 84)
+ (editor-images "objects/bonus_block/bonus-tramp.png")
+ (data 7)
+ (fps 15)
+ )
+
+ (tile
(id 2943)
(images
"objects/bonus_block/full-0.png"
)
(tilegroup
(name "Block")
- (tiles 27 28 29 47 48 50 49 211 77 51 52 212 78 62 61 213 44 83 84 102 140 103 104 105 112 128 1311 2153 2943)
+ (tiles 27 28 29 47 48 50 49 211 77 51 52 212 78 62 61 213 44 83 84 102 140 103 104 105 112 128 2943 2944 2945 2946 1311 2153)
)
(tilegroup
(name "Background")
(image "tiles/snow/slope-upper.png" )
)
-;; next-id: 2944
+;; next-id: 2947
)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 128
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 160
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 192
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 224
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 0 0 0 0 0 0 0 0 0 0 0 44 0 0 0 0 0 0 0 0 0 ; 224
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 256
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 288
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 320
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; 384
0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 132 0 ; 704
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 48 8 ; 736
#include "object/portable.hpp"
#include "object/specialriser.hpp"
#include "object/star.hpp"
+#include "object/trampoline.hpp"
#include "sprite/sprite_manager.hpp"
#include "supertux/constants.hpp"
#include "supertux/level.hpp"
contents(),
object(0),
hit_counter(1),
- lightsprite(Surface::create("/images/objects/lightmap_light/bonusblock_light.png"))
+ lightsprite()
{
bbox.set_pos(pos);
sprite->set_action("normal");
case 3: contents = CONTENT_STAR; break;
case 4: contents = CONTENT_1UP; break;
case 5: contents = CONTENT_ICEGROW; break;
- case 6: contents = CONTENT_LIGHT; sound_manager->preload("sounds/switch.ogg"); break;
+ case 6: contents = CONTENT_LIGHT;
+ sound_manager->preload("sounds/switch.ogg");
+ lightsprite=Surface::create("/images/objects/lightmap_light/bonusblock_light.png");
+ break;
+ case 7: contents = CONTENT_TRAMPOLINE; break;
+ case 8: contents = CONTENT_PORTTRAMPOLINE; break;
+ case 9: contents = CONTENT_ROCK; break;
default:
log_warning << "Invalid box contents" << std::endl;
contents = CONTENT_COIN;
contents(),
object(0),
hit_counter(1),
- lightsprite(Surface::create("/images/objects/lightmap_light/bonusblock_light.png"))
+ lightsprite()
{
Vector pos;
} else if(contentstring == "light") {
contents = CONTENT_LIGHT;
sound_manager->preload("sounds/switch.ogg");
+ } else if(contentstring == "trampoline") {
+ contents = CONTENT_TRAMPOLINE;
+ } else if(contentstring == "porttrampoline") {
+ contents = CONTENT_PORTTRAMPOLINE;
+ } else if(contentstring == "rock") {
+ contents = CONTENT_ROCK;
} else {
log_warning << "Invalid box contents '" << contentstring << "'" << std::endl;
}
if(contents == CONTENT_CUSTOM && object == 0)
throw std::runtime_error("Need to specify content object for custom block");
+ if(contents == CONTENT_LIGHT)
+ lightsprite = Surface::create("/images/objects/lightmap_light/bonusblock_light.png");
bbox.set_pos(pos);
}
else
sprite->set_action("on");
sound_manager->play("sounds/switch.ogg");
+ break;
+ }
+ case CONTENT_TRAMPOLINE:
+ {
+ SpecialRiser* riser = new SpecialRiser(get_pos(), new Trampoline(get_pos(), false));
+ sector->add_object(riser);
+ sound_manager->play("sounds/upgrade.wav");
+ break;
+ }
+ case CONTENT_PORTTRAMPOLINE:
+ {
+ SpecialRiser* riser = new SpecialRiser(get_pos(), new Trampoline(get_pos(), true));
+ sector->add_object(riser);
+ sound_manager->play("sounds/upgrade.wav");
+ break;
+ }
+ case CONTENT_ROCK:
+ {
+ SpecialRiser* riser = new SpecialRiser(get_pos(),
+ new Rock(get_pos(), "images/objects/rock/rock.sprite"));
+ sector->add_object(riser);
+ sound_manager->play("sounds/upgrade.wav");
+ break;
}
}
CONTENT_1UP,
CONTENT_CUSTOM,
CONTENT_SCRIPT,
- CONTENT_LIGHT
+ CONTENT_LIGHT,
+ CONTENT_TRAMPOLINE,
+ CONTENT_PORTTRAMPOLINE,
+ CONTENT_ROCK
};
protected:
}
}
+Trampoline::Trampoline(const Vector& pos, bool port) :
+ Rock(pos, "images/objects/trampoline/trampoline.sprite"),
+ portable(port)
+{
+ sound_manager->preload(TRAMPOLINE_SOUND);
+ if(!port) {
+ sprite_name = "images/objects/trampoline/trampoline_fix.sprite";
+ sprite = sprite_manager->create(sprite_name);
+ sprite->set_action("normal");
+ }
+}
+
void
Trampoline::update(float elapsed_time)
{
{
public:
Trampoline(const Reader& reader);
+ Trampoline(const Vector& pos, bool port);
HitResponse collision(GameObject& other, const CollisionHit& hit);
void collision_solid(const CollisionHit& hit);