RedKnight91

GMS Event Framework usage example

Dec 17th, 2019
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //initEventTypes script
  2. EventTypes { MOUSE_CLICK, KEY_PRESS, GAME_WIN, SCORE_REACH_9000, SIZE }
  3.    
  4. //Any instance
  5. listen(EventTypes.SCORE_REACH_9000, sayOver9000)
  6.    
  7. //Instance responsible for score tracking
  8. if (score > 9000) emitEvent(EventTypes.SCORE_REACH_9000, [score])
  9.  
  10. //Script sayOver9000(eventData)
  11. var eventData = argument0
  12. var score = eventData[0]
  13. show_message_async("IT'S OVER 9000!!! Your score is: " + string(score))
Advertisement
Add Comment
Please, Sign In to add comment