Hi All,
I am a little stuck here, hope I could get some help.
I am trying to use director class and event.shake to switch between 2 screens. I have used the following code.
1 2 3 4 5 6 7 | local function changeHours ( event ) if event.isShake == true then director:changeScene("mainEng") end end Runtime:addEventListener("accelerometer",changeHours) |
Try this…
1 2 3 4 5 6 7 8 | local function changeHours ( event ) if event.isShake == true then Runtime:removeEventListener("accelerometer",changeHours) director:changeScene("mainEng") end end Runtime:addEventListener("accelerometer",changeHours) |
views:1331 update:2011/10/12 18:33:00