You can assign multiple return values from a function with the assignment operator, you just need to introduce additional variables.
Code: Select all
local p1x, p1y, p2x, p2y, p3x, p3y = objects.ground.body:getWorldPoints(objects.ground.shape:getPoints())
love.graphics.polygon("fill", p1x, p1y, p2x, p2y, p3x, p3y)
Of course, this works mostly if you already know ahead of time how many points your polygon will have, because as far as I know, love.graphics.polygon will fail if any of the passed variables is nil.
Wrapping the points into a table like BrotSagtMist pointed out works, too. However, this is not advisable because you'll be creating a new table every time such code is run (every frame when drawing), which is rather needlessly costly. As such, for any arbitrarily sized polygons, you're better off using the first line of code in your opening post.