I think I have the variables I need, but I’m not sure what to do with them, or how to proceed wit finishing the for loop. Help?
--[[
This function generates a list of coordinates for a spiral galaxy.
The for loop is not finished, due to lack of knowledge
--]]
function SpiralCoords(Width, Height, Radius, MinDistanceBetweenStars, NumberOfStars)
local v = {}
local w = Width
local h = Height
local r = Radius
local dist = MinDistanceBetweenStars
local directions = {"up", "down", "left", "right"}
local d = directions[math.random(1,4)]
local x, y = w/2, h/2
local c --coordinate
for i = 1, NumberOfStars do
x = x
y = y
r = r
c = vec2(x, y)
table.insert(v, c)
end
return v
end