code: function(p1, p2, check_walls, check_items) {
          var minres = false;
          
          // collide with walls
          if(check_walls) {
            for(var i=0,n=this.walls.length;i<n;i++) {
              var wall = this.walls[i];
              var res = line_intersect(p1, p2, wall.p1, wall.p2);
              if(res) {
                res.type = 0; // 0 is wall
                if(!minres) { minres=res; }
                else {
                  // check if its closer
                  if(res.ua < minres.ua) {
                    // if yes replace it
                    minres = res;
                  }
                }
              }
            }
          }
          
          // collide with items
          if(check_items) {
            for(var i=0,n=this.items.length;i<n;i++) {
              var it = this.items[i];
              var res = line_point_intersect(p1, p2, it.p, it.rad);
              if(res) {
                res.type = it.type; // store type of item
                if(!minres) { minres=res; }
                else { if(res.ua < minres.ua) { minres = res; }
                }
              }
            }
          }
          
          return minres;
        }
docs: helper function to get closest colliding walls/items