Code Sample |
-- based on last code "patch" if distance <= 25 then -- warp it offscreen ball[i]:color(b) -- delete old 2 lines, add if math.random(0,1) == 0 then bx = math.random(0,1)*max_x by = math.random(1,max_y) else bx = math.random(1,max_x) by = math.random(0,1)*max_y end end |
Quote |
This one make them warp offscreen, but looks 'square-ish' unless you add an additional offset to it (due to choosing a coordinate on the edges of the window box). Not sure how many random()'s you'd want to use. |
Code Sample |
(Distance From Objective) < (Random Number) |