The code below is more or less taken from the multipuck example. Its function is to remove any pucks that slide off the screen.
-- Automatic culling of offscreen objects
local function removeOffscreenItems()
for i = 1, #allball do
local oneball = allball[i]
if (oneball.x) then
if oneball.x \< 50 or oneball.x \> display.contentWidth - 50 or oneball.y \< 30 or oneball.y \> display.contentHeight - 30 then
oneball:removeSelf()
end
end
end
end
I think I have a general understanding of the above code except for the line that reads:
if (oneball.x) then
Could someone explain to me what this line of code does?
[import]uid: 78150 topic_id: 15720 reply_id: 315720[/import]