make_objects = function ()
local objectS = {}
for i=1,10 do
-- create new object
local obj = {}
-- describe its contents
obj = {}
obj.x = 100
obj.y = 100
obj.body = love.physics.newBody(world, obj.x, obj.y, "dynamic")
obj.shape = love.physics.newRectangleShape(21,21)
obj.fixture = love.physics.newFixture(obj.body, obj.shape, 1)
-- define it as item #i in objectS
objectS[i] = obj
end
return objectS
end
Note: you should always call a table that represents a set of items (a collection) with a plural 's'. Unless there is an obvious name such as 'colony' for a set of ants or 'palette' for a set of colours (or 'staff' for a set of employees). Also, it is a good idea --to avoid mistakes or typos-- to use a shortcut name for items, in a loop that processes items in a row (as I did with 'obj' above).
t = {}
for x=1, 10 do
t[x] = {}
t[x].property = "value"
end
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.