lib/minigl/movement.rb
def cycle(points, speed, obstacles = nil, obst_obstacles = nil, obst_ramps = nil)
      @cur_point = 0 if @cur_point.nil?
      if obstacles
        move_carrying points[@cur_point], speed, obstacles, obst_obstacles, obst_ramps
      else
        move_free points[@cur_point], speed
      end
      if @speed.x == 0 and @speed.y == 0
        if @cur_point == points.length - 1; @cur_point = 0
        else; @cur_point += 1; end
      end
    end
def cycle(points, speed, obstacles = nil, obst_obstacles = nil, obst_ramps = nil)
      @cur_point = 0 if @cur_point.nil?
      if obstacles
        move_carrying points[@cur_point], speed, obstacles, obst_obstacles, obst_ramps
      else
        move_free points[@cur_point], speed
      end
      if @speed.x == 0 and @speed.y == 0
        if @cur_point == points.length - 1; @cur_point = 0
        else; @cur_point += 1; end
      end
    end
Causes the object to move in cycles across multiple given points (the
 first point in the array is the first point the object will move towards,
 so it doesn't need to be equal to the current/initial position). If
 obstacles are provided, it will behave as an elevator (as in
 +move_carrying+).

 Parameters:
 [points] An array of Vectors representing the path that the object will
          perform.
 [speed] The constant speed at which the object will move. This must be
         provided as a scalar, not a vector.
 [obstacles] An array of obstacles to be considered in the collision
             checking, and carried along when colliding from above.
             Obstacles must be instances of Block (or derived classes),
             or objects that <code>include Movement</code>.
 [obst_obstacles] Obstacles that should be considered when moving objects
                  from the +obstacles+ array, i.e., these obstacles won't
                  interfere in the elevator's movement, but in the movement
                  of the objects being carried.
 [obst_ramps] Ramps to consider when moving objects from the +obstacles+
              array, as described for +obst_obstacles+.