我再次做了一些lua(Love2D),我想請求一些表格作爲我的love.graphics.rectangle
s的X/Y座標。我的代碼是這樣的。從表格調用到x,y
function love.load()
x=0
y=0
x2={}
y2={}
end
function love.update(dt)
if love.keyboard.isDown(" ") then
table.insert(x2, x)
table.insert(y2, y)
end
end
function love.draw()
for i,v in pairs(--What should I do here?--) do
love.graphics.rectangle("fill", --How would I make these coordinates match the ones in the table?--)
end
end
我的代碼不是這樣,但它只是顯示我要去的。
請將您的問題作爲文本說明,而不是埋在您代碼的註釋中。 –
什麼是'x'和'y'?你想在'love.graphics.rectangle'調用中使用哪些座標? –
很抱歉,在我的實際代碼中,我已經照顧好了。我只想調用x2和y2中的值並將它們存儲在love.graphics.rectangle函數中,如love.graphics.rectangle(「fill」,x2value,y2value,10,10) –