Skip to content

Instantly share code, notes, and snippets.

@milesrout
Last active September 23, 2016 11:49
Show Gist options
  • Save milesrout/a0a23ddcd1b229addd421527e27772f6 to your computer and use it in GitHub Desktop.
Save milesrout/a0a23ddcd1b229addd421527e27772f6 to your computer and use it in GitHub Desktop.
; If you look at this you'll get wrecked.
(register-event concrete-block event-type-player-look
(lambda (ev)
(cause-effect
#:type 'explosion
#:at (event-triggering-object ev)
#:radius 100)))
; Set up a dialogue box that will pop up congratulating you every
; time you level up.
(define congrats-dialogue
(dialogue
#:capture-focus #t
#:modal #t))
(register-event congrats-dialogue event-player-level-up
(lambda (ev this)
(add-textbox this
(textbox (format "Congratulations on reaching level %"
(lookup 'level ev))))
(clear-buttons this)
(add-button this #:label "OK"
(lambda (click)
(close-dialogue this)))
(show-dialogue this)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment