For cycle won't work because "attempt to index local 'v' (a number value)"
Posted: Wed Dec 21, 2016 10:50 pm
Hello, so, when running spaceinvaders.love (File attached). And pressing space, I get an error message: main.lua:64: attempt to index local value 'v' (A number value).
This is the for cicle:
for k, v in pairs(bullet) do
love.graphics.rectangle("fill", v[bulx], v[buly], 10, 10)
You can see the entire thing in main.lua (also attached), but here is the associative array "bullet," just in case:
bullet = {
bulx = (player.x + 10),
buly = player.y,
}
Thank you very much, for anyone who is able to help.
This is the for cicle:
for k, v in pairs(bullet) do
love.graphics.rectangle("fill", v[bulx], v[buly], 10, 10)
You can see the entire thing in main.lua (also attached), but here is the associative array "bullet," just in case:
bullet = {
bulx = (player.x + 10),
buly = player.y,
}
Thank you very much, for anyone who is able to help.