I also see in the pastebin snippet that you define bullet.speed, but nowhere are any numeric keys defined inside bullet, much less a dx or dy member for them.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
zorg wrote:I also see in the pastebin snippet that you define bullet.speed, but nowhere are any numeric keys defined inside bullet, much less a dx or dy member for them.
function bullet.update(dt)
for i,v in ipairs(bullet) do
v.x = v.x + (v.dx * dt)
v.y = v.y + (v.dy * dt)
end
end
v would be bullet, but bullet does not have any members with number keys (only speed, x, y, etc...), and even if it would, they would still lack the dx and dy keys.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
function bullet.update(dt)
for i,v in ipairs(bullet) do
v.x = v.x + (v.dx * dt)
v.y = v.y + (v.dy * dt)
end
end
v would be bullet, but bullet does not have any members with number keys (only speed, x, y, etc...), and even if it would, they would still lack the dx and dy keys.
The fact is, I literally copypasted it from Love's wiki, but it still doesnt work.
I'm new to programming so I have no idea of what's wrong, could you please tell me how I should do it then?