下面是我的游戏代码,它是用Corona SDK用LUA编写的。
触摸功能在模拟器中不起作用。
任何帮助将不胜感激。
local physics = require "physics"
physics.start()
--jet
local jet = display.newImage("redJet.png")
jet.x = 100
jet.y = 100
physics.addBody(jet,"dynamic", {density=.1, bounce=0.1, friction=.2,radius=12})
function acivateJets(self,event)
self.applyForce(0, -1.5, self.x, self.y)
end
function touchScreen(event)
if event.phase == "began" then
jet.enterFrame = activateJets
Runtime:addEventListener("enterFrame", jet)
end
if event.phase == "ended" then
end
end
Runtime:addEventListener("touch", touchScreen)