I have a function that shoots bullets
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | --shoot bullets local shootBullets = function(event) local bullet = display.newImage("bullet.png") bullet.x = 0 bullet.y = display.contentCenterY physics.addBody( bullet, { density=3.0, friction=0.5, bounce=0.05 } ) bullet.isBullet = true bullet.rotation = false bullet:setLinearVelocity( event.x, event.y-180 ) print(event.y) end |
ignore this post. I didn't know there was a tap event.
I changed "touch" to "tap" and now I got what I want. Thank you! :-)
By the way LUA is very very easy and my lines of codes are 1/3 of what they would be vs. when I was developing this game in AS3