Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function handleturn()
- print("doing all the turn stuff here")
- Runtime:dispatchEvent( "customevent", { type="handleTurn" } )
- end
- function myEventHandler(event)
- if event.type == "handleTurn" then handleturn() end
- end
- handleturn() -- trigger first time
- Runtime:addEventListener("customevent", myEventHandler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement