--- /dev/null
+(supertux-sprite
+ (action
+ (name "empty")
+ (images "empty.png"))
+ (action
+ (name "normal")
+ (images "../../tiles/blocks/brick1.png"))
+)
#include "supertux/constants.hpp"
#include "supertux/sector.hpp"
-Brick::Brick(const Vector& pos, int data)
- : Block(sprite_manager->create("images/objects/bonus_block/brick.sprite")), breakable(false),
+Brick::Brick(const Vector& pos, int data, const std::string& spriteName)
+ : Block(sprite_manager->create(spriteName)), breakable(false),
coin_counter(0)
{
bbox.set_pos(pos);
class Brick : public Block
{
public:
- Brick(const Vector& pos, int data);
+ Brick(const Vector& pos, int data, const std::string& spriteName);
void try_break(Player* player);
HitResponse collision(GameObject& other, const CollisionHit& hit);
add_object(new BonusBlock(pos, tile->getData()));
solids->change(x, y, 0);
} else if(tile->getAttributes() & Tile::BRICK) {
- add_object(new Brick(pos, tile->getData()));
+ if( ( id == 78 ) || ( id == 105 ) ){
+ add_object( new Brick(pos, tile->getData(), "images/objects/bonus_block/brickIce.sprite") );
+ } else if( ( id == 77 ) || ( id == 104 ) ){
+ add_object( new Brick(pos, tile->getData(), "images/objects/bonus_block/brick.sprite") );
+ } else {
+ log_warning << "attribute 'brick #t' is not supported for tile-id " << id << std::endl;
+ add_object( new Brick(pos, tile->getData(), "images/objects/bonus_block/brick.sprite") );
+ }
solids->change(x, y, 0);
} else if(tile->getAttributes() & Tile::GOAL) {
std::string sequence = tile->getData() == 0 ? "endsequence" : "stoptux";