//
// SuperTux - MagicBlock
//
-// Magic Blocks are tile-like game objects that are sensitive to
+// Magic Blocks are tile-like game objects that are sensitive to
// lighting conditions. They are rendered in a color and
// will only be solid as long as light of the same color shines
// on the block.
void
MagicBlock::update(float elapsed_time)
{
- //Check if center of this block is on screen.
+ //Check if center of this block is on screen.
//Don't update if not, because there is no light off screen.
float screen_left = Sector::current()->camera->get_translation().x;
float screen_top = Sector::current()->camera->get_translation().y;
context.draw_filled_rect( get_bbox(), color, layer);
}
+bool
+MagicBlock::collides(GameObject& /*other*/, const CollisionHit& /*hit*/)
+{
+ return is_solid;
+}
+
HitResponse
MagicBlock::collision(GameObject& /*other*/, const CollisionHit& /*hit*/)
{
- if(is_solid) {
- return SOLID;
- } else {
- return PASSTHROUGH;
- }
+ return SOLID;
}
IMPLEMENT_FACTORY(MagicBlock, "magicblock");