Hey, i didnt have it on the enterFrame listener… but now i do and still nothing…
Heres the whole function
local function showBullet(event) if event.phase == "began" then bullet = display.newImageRect( "bullet.png", 2, 8 ) bullet.x = display.contentCenterX bullet.y = display.contentHeight \* 0.9 physics.addBody( bullet, "dynamic" ) bullet.gravityScale = 0 bullet.myName = "bullet" bullet.isFixedRotation = true elseif event.phase == "ended" then local function shootBullet() bullet:applyLinearImpulse( 0, -1, bullet.x, bullet.y ) end Runtime:addEventListener( "enterFrame", shootBullet ) end end BG:addEventListener( "touch", showBullet )
So when the background is pressed the bullet apears and when released the bullet is supposed to fire at a slow motion speed … but doesn’t seem to want to works…
This is being all done in main.lua
Thanks