Hello!
I’ve done some reading and I can’t figure out the best way to create a bullet, shoot it (from left to right), and properly dispose the bullet when it’s off the screen. Assuming that I’m using a screen that’s 320x480 in landscape.
local bullet = display.newImage("bullet.png") transition.to(bullet, { time = 1000, x = 400, onComplete = function(bullet) display.remove(bullet) end })
Is this the right way to create a bullet, move it, and remove it at the end of the transition? Is there a better way or something that follows best practices?
Thank you for your help!