- if (tile->images.size() > 0)
- context.draw_surface_part(tile->images[0],
- Vector(rand() % 16, rand() % 16),
- Vector(16, 16),
- position, LAYER_OBJECTS + 1);
-}
-
-BouncyBrick::BouncyBrick(const Vector& pos)
- : position(pos), offset(0), offset_m(-BOUNCY_BRICK_SPEED),
- shape(Sector::current()->solids->get_tile_id_at(pos))
-{
- shape.hidden = true;
-}
-
-void
-BouncyBrick::action(float elapsed_time)
-{
- offset += offset_m * elapsed_time;
-
- /* Go back down? */
- if (offset < -BOUNCY_BRICK_MAX_OFFSET)
- offset_m = BOUNCY_BRICK_SPEED;
-
- /* Stop bouncing? */
- if (offset >= 0)
- {
- shape.hidden = false;
- remove_me();
- }
+ sprite->draw_part(context,
+ Vector(rand() % 16, rand() % 16), Vector(16, 16),
+ position, LAYER_OBJECTS + 1);