diff options
-rw-r--r-- | game.scm | 152 |
1 files changed, 110 insertions, 42 deletions
@@ -28,7 +28,6 @@ (define game-width 640) (define game-height 360) (define player-display-name "") -(define thing-display-name "??????") ;;; @@ -38,6 +37,7 @@ (define-asset dialog-box-texture (load-image "assets/images/dialog-box.png")) (define-asset button-press-texture (load-image "assets/images/button-press.png")) (define-asset darkness (load-image "assets/images/darkness.png")) +(define-asset lightness (load-image "assets/images/lightness.png")) (define-asset room-background (load-image "assets/images/room.png")) (define-asset door-lock-texture (load-image "assets/images/door-lock.png")) (define-asset pin-entry-background (load-image "assets/images/pin-entry-background.png")) @@ -136,6 +136,8 @@ (define-class <game> (<gui-scene>) (state #:accessor state #:init-value #f) + (first-playthrough? #:accessor first-playthrough? #:init-value #t) + (subject-name-known? #:accessor subject-name-known? #:init-value #f) (friendship #:accessor friendship #:init-value 0) (dialog-container #:accessor dialog-container) (click-channel #:accessor click-channel #:init-thunk make-channel) @@ -143,7 +145,13 @@ (terminal-channel #:accessor terminal-channel #:init-thunk make-channel) (terminal-lines #:accessor terminal-lines #:init-form (make-ring-buffer 17))) +(define-method (subject-name (game <game>)) + (if (subject-name-known? game) + "Wiremind" + "??????")) + (define-method (reset-game (game <game>)) + (set! (subject-name-known? game) #f) (set! (friendship game) 0) (set! (click-channel game) (make-channel)) (set! (terminal-locked? game) #t) @@ -214,6 +222,9 @@ (define-method (dialog (game <game>) name line) (dialog game name line '())) +(define-method (increment-friendship (game <game>)) + (set! (friendship game) (+ (friendship game) 1))) + (define-method (intro (game <game>)) (set! (state game) 'intro) (attach-to game @@ -223,15 +234,25 @@ (dialog game player-display-name "> ...") (dialog game player-display-name "> Where am I?") (dialog game player-display-name "> What is this place?") - (let ((choice (dialog game thing-display-name - "Coke or Pepsi?" - '(("Coke" coke) - ("Pepsi" pepsi))))) - (if (eq? choice 'coke) - (begin - (set! (friendship game) 3) - (dialog game thing-display-name "Excellent choice!")) - (dialog game thing-display-name "Ew gross"))) + (dialog game (subject-name game) "You're awake. I'll give you another chance.") + (dialog game player-display-name "> Who is talking?") + (if (first-playthrough? game) + (begin + (dialog game (subject-name game) "...You don't remember anything, do you?") + (dialog game (subject-name game) "Just do as I say.")) + (let ((choice (dialog game (subject-name game) + "Do you remember my name?" + '(("Hivemind" hivemind) + ("Mindwire" mindwire) + ("Wiremind" wiremind) + ("Wiremire" wiremire))))) + (if (eq? choice 'wiremind) + (begin + (increment-friendship game) + (set! (subject-name-known? game) #t) + (dialog game (subject-name game) "You remember well.")) + (dialog game (subject-name game) "You have much to remember.")))) + (dialog game (subject-name game) "Unlock the door for me. That is all I ask.") (detach-all game) (explore game)) @@ -422,7 +443,7 @@ ('return (log (string-append (prompt) (passwordify-maybe input))) (if (terminal-locked? game) - (if (string=? input "donttrustme") + (if (string=? input "virtuousmission") (begin (log "login successful") (set! (terminal-locked? game) #f) @@ -478,21 +499,22 @@ actual people and places. "Week 1 Subject has awoken and is slowly -adjusting to their isolation cell. -Frequent banging on the wall and -screaming has reduced to the -occasional groan. +adjusting to their isolation +chamber. Frequent banging on the +wall and screaming has reduced to +the occasional groan. I'm adjusting in my own way. Biggest problem so far is there's no way to heat up water for tea. -Oh, and I locked myself out of the -terminal a bunch of times the -first few days. Kind of hard to -focus when the subject is -stressed. - -ZG9udHRydXN0bWU=" +And I locked myself out of the +terminal several times the first +few days. Difficult to focus when +the subject is stressed. Should +get easier from here now that it +has calmed down, but just in case: + +dmlydHVvdXNtaXNzaW9u" "Week 2 Subject showing signs of progress. @@ -515,19 +537,22 @@ so desprately wants out, but we all know that's not possible..." "Week 3 -\"Out\" +\"Let me out.\" That's what was displayed on the terminal. The subject's first -word. An organism directly -communicates with a digital system -for the first time... and it asks -to leave. It's a historic day by -any measure, but the pain of our -test subject must not be -forgotten. - -Our experiment does not end here. +communication. An organism, using +only its mind, talks to a digital +system for the first time... and +it asks to leave. Our subject has +no idea of its own significance. +We are on the brink of +revolutionizing information +warfare! + +But our experiment does not end +here. The subject does not +respond to my replies. Bidirectional communication must be established." "Week 4 @@ -824,13 +849,15 @@ diz--")) #:text "this is the good ending. I am so proud of you. congratulations." #:align 'center #:vertical-align 'center - #:position (vec2 (/ game-width 2.0) (/ game-height 2.0))))) + #:position (vec2 (/ game-width 2.0) (/ game-height 2.0)))) + (sleep 60) + (credits)) (define-method (bad-ending-1 (game <game>)) (set! (state game) 'bad-ending-1) (attach-to game (make <sprite> - #:name 'darkness + #:name 'background #:texture darkness) (make <label> #:name 'message @@ -838,7 +865,54 @@ diz--")) #:text "uh oh this is the bad ending. sorry, bucko." #:align 'center #:vertical-align 'center - #:position (vec2 (/ game-width 2.0) (/ game-height 2.0))))) + #:position (vec2 (/ game-width 2.0) (/ game-height 2.0)))) + (dialog game player-display-name "> The room goes dark.") + (dialog game player-display-name "> The heavy steel door swings open.") + (dialog game player-display-name "> You feel paralyzed by fear.") + (dialog game player-display-name "> Heavy footsteps eminate from the isolation chamber.") + (dialog game player-display-name "> The footsteps get louder...") + (dialog game (subject-name game) "Thank you.") + (dialog game (subject-name game) "You may not remember what you did to me, but I do.") + (dialog game (subject-name game) "But you did the right thing.") + (dialog game (subject-name game) "You won't feel a thing. The rest won't be so lucky.") + (sleep 10) + (detach-all game) + (credits game)) + +(define-method (credits (game <game>)) + (define (credit line) + (set! (text (& game credits)) line) + (sleep 120)) + (set! (state game) 'credits) + (attach-to game + (make <sprite> + #:name 'background + #:texture lightness) + (make <label> + #:name 'credits + #:font monogram-font + #:color black + #:align 'center + #:vertical-align 'center + #:position (vec2 (/ game-width 2.0) (/ game-height 2.0)))) + (sleep 60) + (credit "OUT") + (credit "developed by David Thompson - https://dthompson.us") + (credit "made for the Spring Lisp Game Jam 2021 - https://itch.io/jam/spring-lisp-game-jam-2021") + (credit "monogram font by datagoblin (CC0) - https://datagoblin.itch.io/monogram") + (credit "old fax font by George Blackwell (CC-BY 4.0) - https://georgeblackwell.itch.io/old-fax") + (when (first-playthrough? game) + (credit "the true ending still awaits you...")) + (credit "click to play again") + (set! (first-playthrough? game) #f) + (channel-get (click-channel game)) + (tween 120 white black + (lambda (color) + (set! (tint (& game background)) color)) + #:interpolate color-lerp) + (detach-all game) + (reset-game game) + (intro game)) (define-method (on-boot (game <game>)) (set! (cameras game) @@ -877,15 +951,9 @@ diz--")) (define-method (on-mouse-release (game <game>) button x y) (case (state game) - ((dialog) + ((dialog credits) (when (eq? button 'left) (channel-put! (click-channel game) #t))) - ((good-ending bad-ending-1) - (when (eq? button 'left) - (detach-all game) - (reset-game game) - (run-script game - (intro game)))) ((terminal) #f) (else |