触摸不起作用,即使没有任何错误和正确的功能

以下是在 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)
点赞