Ich versuche, dieseVersuch Tabellenwert in der Tabelle zugreifen
local ball = {
width = 20,
height = 20,
position = {
x = (game.width/2) - (width/2), -- Place the ball at the center of the screen
y = (game.height/2) - (height/2)
},
velocity = 200,
color = { 255, 255, 255 }
}
zu tun, aber Love2D sagen mir attempt to perform arithmetic on global 'width' (a nil value)
. Wie kann ich es reparieren?
Ich habe bereits versucht, width/2
durch ball.width/2
zu ersetzen, aber ich habe attempt to index global 'ball' (a nil value)
. Denken Sie daran,
Oh du hast Recht! Danke für diese nützliche Erinnerung! – Wizix