lives and victories and credits

parent dc8cef4e
......@@ -13,7 +13,8 @@
(define render-layer-order
......@@ -108,10 +109,7 @@
(define (terrain-speed-char? char)
(hash-has-key? terrain-speed-control-chars char))
(define (^level bcom level-tape score-tracker)
(define-cell lives
(define (^level bcom level-tape score-tracker lives)
(define tape-eater
(spawn ^tape-eater level-tape))
......@@ -530,15 +528,18 @@
(define (^level-manager bcom levels dpr-pushdown score-tracker)
(define-cell lives
(define (next-level-state levels)
(if (stream-empty? levels)
(playing levels)))
(define (playing levels)
(define level-tape
(stream-first levels))
(define level
(spawn ^level level-tape score-tracker))
(spawn ^level level-tape score-tracker lives))
(define (maybe-handle-exit-method)
(define exit-reason
......@@ -559,16 +560,29 @@
[(handle-event evt)
($ level 'handle-event evt)
(define (credits)
(define (victory)
(raart:text " omg you beet it heres da credits "))]
#:halign 'center
(raart:text " YOU WIN THE GAME ")
(raart:text "")
(raart:text " Having fought mighty foes, ")
(raart:text " you held on strong and have emerged ")
(raart:text " victorious! Congratulations! ")
(raart:text "")
(raart:text "")
(raart:text " (... upcoming releases will have ")
(raart:text " more levels!) ")))]
[tick no-op]
[(handle-event evt)
(match evt
[(or "q" " " "C-M" "C-[")
($ dpr-pushdown 'pop)]
($ dpr-pushdown 'pop)
;; and now push on the credits
($ dpr-pushdown 'push
(spawn ^credits dpr-pushdown))]
[_ 'no-op])]))
(next-level-state levels))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment