diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2018-07-03 21:30:58 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2018-07-27 17:15:43 +0200 |
commit | 9bd5cf49e1ae917d966d85dd8b4c865b04ab46b3 (patch) | |
tree | 7335100a51c5cf84a9043a0f8c517143d5154941 | |
parent | 7d11e47f2c324ad49ab893dc74eb5e9680f7ae30 (diff) |
Break lines of intro texts.
-rw-r--r-- | scenes/intro.scm | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/scenes/intro.scm b/scenes/intro.scm index 640bdc8..285f0a3 100644 --- a/scenes/intro.scm +++ b/scenes/intro.scm @@ -34,29 +34,49 @@ (load-tile-font "assets/fonts/bubblemad_8x8.png" 8 8 " !\"©_%❤'()*+,-./0123456789:←<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")) - (define texts - '("The void has been suspended for a while.\nYou exist for now." - "Confusion gave way to a brief burst of consciousness.\nHere you are." - "The haze clears and you can see that you are here now.\nYou did not ask for this." - "You rise from deepest waters and take your first breath.\nYou wonder: will this last?" - "History yields to the present.\nThe present crumbles underfoot,\nso you begin to run." - "A leaf has turned.\nThe sunshine warms and blinds.\nThe leaf begins to dry.")) + '("\ +The void has been suspended for +a little while. You exist now." + "\ +Confusion gives way to a brief +burst of consciousness. +Here you are. What now?" + "\ +The haze clears and you can see +that you are here now. You did not +ask for this." + "\ +You rise from deepest waters and +take your first breath. You wonder: +will this last?" + "\ +History yields to the present. +The present crumbles underfoot. +You better move." + "\ +A leaf has turned. The sunshine +warms and blinds. The leaf begins +to dry.")) (set! *random-state* (random-state-from-platform)) (define-method (populate (intro <intro>)) - (list - (make <label> - #:name 'welcome - #:font intro-font - #:text (list-ref texts (random (length texts))) - #:position (vec2 16.0 120.0)) + (cons (make <label> #:name 'press-enter #:font intro-font - #:text "press enter to start." - #:position (vec2 72.0 80.0)))) + #:text "Press enter to start." + #:position (vec2 72.0 50.0)) + (let* ((text (list-ref texts (random (length texts)))) + (parts (string-split text #\newline))) + (map (lambda (part i) + (make <label> + #:name 'welcome + #:font intro-font + #:text part + #:position (vec2 16.0 (- 150.0 (* 12 i))))) + parts (iota (length parts)))))) (define-method (on-key-press (intro <intro>) key mods repeat?) (when (eq? key 'return) |