Advertisement
lavalevel

My handler with event

Feb 7th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1.     function GameLoop()
  2.         print (playerData.playerInfo.turnState)
  3.         if playerData.playerInfo.turnState == "Ready" then
  4.                
  5.             playersTurn()
  6.         elseif playerData.playerInfo.turnState == "DungonMaster"  then
  7.             for i=1, 1000 do
  8.             print ("startMonstersTurn Triggered")
  9.             end
  10.             dungeonMastersTurn()
  11.         elseif playerData.playerInfo.turnState == "startCutScene" then
  12.             print ("startCutScene Triggered")
  13.         elseif playerData.playerInfo.turnState == "sword" then
  14.             print ("sword....")
  15.         end
  16.         -- Runtime:dispatchEvent( "startTheLoop", { type="GameLoop" } )
  17.     end
  18.  
  19.     function myEventHandler(event)
  20.         if event.type == "GameLoop" then
  21.         GameLoop()
  22.         end
  23.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement