Created
March 31, 2013 21:54
-
-
Save dleslie/5282150 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set! video-conf:clear-color (al:make-color-rgb 0 40 70)) | |
(define credits-scene | |
(scene | |
(let* ((screen-padding 50) (credit-text "A game by Dan Leslie") | |
(label-width 200) (label-height 20) | |
(label-left (+ screen-padding (random (- video-conf:width label-width (* 2 screen-padding))))) | |
(label-top (+ screen-padding (random (- video-conf:height label-height (* 2 screen-padding))))) | |
(rect (make-rectangle label-left label-top label-width label-height)) | |
(label (make-label rect credit-text padding-left: 5 padding-right: 5 | |
fore-color: (al:make-color-rgba 255 255 255 255) | |
back-color: (al:make-color-rgba 0 0 0 0)))) | |
(let ((accum 0)) | |
(while-waiting seconds: 5 | |
(let ((p (inexact->exact (truncate (tween quintic-ease 'out 0 255 (/ accum 5)))))) | |
(widget-tint-set! label (al:make-color-rgba 255 255 255 p))) | |
(set! accum (+ accum (current-delta))) | |
(render:add! (render-widget~ label (current-delta)))))))) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Setup Loop | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(main-loop:add! | |
(run-scene! credits-scene (list->signal-table `(,(signal 'time-delta delta))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment