+ else /* facing left */
+ {
+ base.x = tux.base.x - 16;
+ base.y = tux.base.y + tux.base.height/1.5 - base.height;
+ }
+
+ if(collision_object_map(base))
+ {
+ base.x = tux.base.x;
+ base.y = tux.base.y + tux.base.height/1.5 - base.height;
+ }
+ }
+
+ physic.apply(frame_ratio, base.x, base.y);
+ collision_swept_object_map(&old_base, &base);
+}
+
+void
+Trampoline::collision(const MovingObject&, int)
+{
+ // comes later
+}
+
+void
+Trampoline::collision(void *p_c_object, int c_object, CollisionType type)
+{
+ Player* pplayer_c = NULL;
+ switch (c_object)
+ {
+ case CO_PLAYER:
+ pplayer_c = (Player*) p_c_object;
+
+ if (type == COLLISION_NORMAL)
+ {
+ // Pick up if HELD (done in Player)
+ }
+
+ else if (type == COLLISION_SQUISH)
+ {
+ int squish_amount = (32 - (int)pplayer_c->base.y % 32);
+
+ if (squish_amount < 24)
+ frame = 3;
+ else if (squish_amount < 28)
+ frame = 2;
+ else if (squish_amount < 30)
+ frame = 1;
+ else
+ frame = 0;
+
+ if (squish_amount < 20) {
+ pplayer_c->physic.set_velocity_y(power);
+ pplayer_c->fall_mode = Player::TRAMPOLINE_JUMP;
+ }
+ else if (pplayer_c->physic.get_velocity_y() < 0)
+ pplayer_c->physic.set_velocity_y(-squish_amount/32);
+ }
+
+ break;
+
+ default:
+ break;
+
+ }
+}
+
+/* Flying Platform */
+
+Sprite *img_flying_platform;
+
+FlyingPlatform::FlyingPlatform(DisplayManager& displaymanager, LispReader& reader)
+{
+ displaymanager.add_drawable(this, LAYER_OBJECTS);
+
+ reader.read_int_vector("x", &pos_x);
+ reader.read_int_vector("y", &pos_y);
+
+ velocity = 2.0;
+ reader.read_float("velocity", &velocity);
+
+ base.x = pos_x[0];
+ base.y = pos_y[0];
+ base.width = 96;
+ base.height = 40;
+
+ point = 0;
+ move = false;
+
+ frame = 0;