if(platform) {
transform_platform(height, *platform);
}
+ Block* block = dynamic_cast<Block*> (object);
+ if(block) {
+ transform_block(height, *block);
+ }
MovingObject* mobject = dynamic_cast<MovingObject*> (object);
if(mobject) {
transform_moving_object(height, mobject);
pos.y = height - pos.y - platform.get_bbox().get_height();
}
}
+
+void
+FlipLevelTransformer::transform_block(float height, Block& block)
+{
+ block.original_y = height - block.original_y - block.get_bbox().get_height();
+}
#include "level_transformer.hpp"
#include "object/platform.hpp"
#include "object/path.hpp"
+#include "object/block.hpp"
class TileMap;
class BadGuy;
void transform_badguy(float height, BadGuy* badguy);
void transform_spawnpoint(float height, SpawnPoint* spawnpoint);
void transform_platform(float height, Platform& platform);
+ void transform_block(float height, Block& block);
};
#endif
virtual void draw(DrawingContext& context);
protected:
+ friend class FlipLevelTransformer;
+
virtual void hit(Player& player) = 0;
void start_bounce();
float bounce_dir;
float bounce_offset;
float original_y;
+
};
class BonusBlock : public Block