summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2021-04-25 14:07:32 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2021-04-25 14:07:32 -0400
commit4ea611de4efe34a0f193572979c20372d4202b9f (patch)
treea3c0e9b2dbdc8ac3845bf0619bdf8b9d80eaec9a
parentc3f4dadccd78e5ec1cb7ad4d8c1f3e3502313df8 (diff)
Gameplay pretty complete. Add audio.
-rw-r--r--assets/images/control-panel.pngbin1132 -> 1219 bytes
-rw-r--r--assets/images/control-panel.xcfbin5179 -> 6385 bytes
-rw-r--r--assets/images/door-lock.xcfbin2119 -> 2119 bytes
-rw-r--r--assets/images/door.pngbin1174 -> 1112 bytes
-rw-r--r--assets/images/door.xcfbin7031 -> 6671 bytes
-rw-r--r--assets/images/fridge.pngbin874 -> 901 bytes
-rw-r--r--assets/images/fridge.xcfbin4325 -> 4421 bytes
-rw-r--r--assets/images/notebook.pngbin1280 -> 704 bytes
-rw-r--r--assets/images/notebook.xcfbin2008 -> 1883 bytes
-rw-r--r--assets/images/window.pngbin1272 -> 1753 bytes
-rw-r--r--assets/images/window.xcfbin48387 -> 7221 bytes
-rw-r--r--assets/sounds/ambientmain_0.oggbin0 -> 1972219 bytes
-rw-r--r--assets/sounds/blinding-lights.mp3bin0 -> 6299607 bytes
-rw-r--r--assets/sounds/click1.wavbin0 -> 16596 bytes
-rw-r--r--assets/sounds/end-theme.mp3bin0 -> 814462 bytes
-rw-r--r--assets/sounds/switch38.wavbin0 -> 74804 bytes
-rw-r--r--assets/sounds/switch6.wavbin0 -> 61724 bytes
-rw-r--r--game.scm248
18 files changed, 157 insertions, 91 deletions
diff --git a/assets/images/control-panel.png b/assets/images/control-panel.png
index 15c8026..a8c851e 100644
--- a/assets/images/control-panel.png
+++ b/assets/images/control-panel.png
Binary files differ
diff --git a/assets/images/control-panel.xcf b/assets/images/control-panel.xcf
index 6da1bfb..74b1183 100644
--- a/assets/images/control-panel.xcf
+++ b/assets/images/control-panel.xcf
Binary files differ
diff --git a/assets/images/door-lock.xcf b/assets/images/door-lock.xcf
index 57d3e64..2435560 100644
--- a/assets/images/door-lock.xcf
+++ b/assets/images/door-lock.xcf
Binary files differ
diff --git a/assets/images/door.png b/assets/images/door.png
index 9c47ecb..f60679a 100644
--- a/assets/images/door.png
+++ b/assets/images/door.png
Binary files differ
diff --git a/assets/images/door.xcf b/assets/images/door.xcf
index 4f782ac..bd02332 100644
--- a/assets/images/door.xcf
+++ b/assets/images/door.xcf
Binary files differ
diff --git a/assets/images/fridge.png b/assets/images/fridge.png
index 652a1b2..c57cfd7 100644
--- a/assets/images/fridge.png
+++ b/assets/images/fridge.png
Binary files differ
diff --git a/assets/images/fridge.xcf b/assets/images/fridge.xcf
index f473f0e..15652e9 100644
--- a/assets/images/fridge.xcf
+++ b/assets/images/fridge.xcf
Binary files differ
diff --git a/assets/images/notebook.png b/assets/images/notebook.png
index aa93b20..adeb8ec 100644
--- a/assets/images/notebook.png
+++ b/assets/images/notebook.png
Binary files differ
diff --git a/assets/images/notebook.xcf b/assets/images/notebook.xcf
index db99898..3d52abb 100644
--- a/assets/images/notebook.xcf
+++ b/assets/images/notebook.xcf
Binary files differ
diff --git a/assets/images/window.png b/assets/images/window.png
index aba021e..d4fc02e 100644
--- a/assets/images/window.png
+++ b/assets/images/window.png
Binary files differ
diff --git a/assets/images/window.xcf b/assets/images/window.xcf
index ebf54b3..ba250f9 100644
--- a/assets/images/window.xcf
+++ b/assets/images/window.xcf
Binary files differ
diff --git a/assets/sounds/ambientmain_0.ogg b/assets/sounds/ambientmain_0.ogg
new file mode 100644
index 0000000..631301d
--- /dev/null
+++ b/assets/sounds/ambientmain_0.ogg
Binary files differ
diff --git a/assets/sounds/blinding-lights.mp3 b/assets/sounds/blinding-lights.mp3
new file mode 100644
index 0000000..8715184
--- /dev/null
+++ b/assets/sounds/blinding-lights.mp3
Binary files differ
diff --git a/assets/sounds/click1.wav b/assets/sounds/click1.wav
new file mode 100644
index 0000000..ec55432
--- /dev/null
+++ b/assets/sounds/click1.wav
Binary files differ
diff --git a/assets/sounds/end-theme.mp3 b/assets/sounds/end-theme.mp3
new file mode 100644
index 0000000..c8f8c50
--- /dev/null
+++ b/assets/sounds/end-theme.mp3
Binary files differ
diff --git a/assets/sounds/switch38.wav b/assets/sounds/switch38.wav
new file mode 100644
index 0000000..64a0946
--- /dev/null
+++ b/assets/sounds/switch38.wav
Binary files differ
diff --git a/assets/sounds/switch6.wav b/assets/sounds/switch6.wav
new file mode 100644
index 0000000..449ab53
--- /dev/null
+++ b/assets/sounds/switch6.wav
Binary files differ
diff --git a/game.scm b/game.scm
index bab5447..ef0234c 100644
--- a/game.scm
+++ b/game.scm
@@ -1,4 +1,5 @@
(define-module (game)
+ #:use-module (chickadee audio)
#:use-module (chickadee graphics color)
#:use-module (chickadee graphics font)
#:use-module (chickadee graphics texture)
@@ -52,6 +53,11 @@
(define-asset monogram-font (load-font "assets/fonts/monogram_extended.ttf" 12))
(define-asset monogram-font-big (load-font "assets/fonts/monogram_extended.ttf" 24))
(define-asset old-fax-font (load-font "assets/fonts/old-fax.ttf" 12))
+(define-asset click-sound (load-audio "assets/sounds/click1.wav"))
+(define-asset key-press-sound (load-audio "assets/sounds/switch6.wav"))
+(define-asset device-sound (load-audio "assets/sounds/switch38.wav"))
+(define-asset background-music (load-audio "assets/sounds/ambientmain_0.ogg" #:mode 'stream))
+(define-asset credits-music (load-audio "assets/sounds/end-theme.mp3" #:mode 'stream))
;;;
@@ -148,13 +154,24 @@
(click-channel #:accessor click-channel #:init-thunk make-channel)
(terminal-locked? #:accessor terminal-locked? #:init-value #t)
(terminal-channel #:accessor terminal-channel #:init-thunk make-channel)
- (terminal-lines #:accessor terminal-lines #:init-form (make-ring-buffer 17)))
+ (terminal-lines #:accessor terminal-lines #:init-form (make-ring-buffer 17))
+ (key-pad-locked? #:accessor key-pad-locked? #:init-value #t)
+ (audio-source #:accessor audio-source #:init-form (make-source #:loop? #t)))
(define-method (subject-name (game <game>))
(if (subject-name-known? game)
"The Wiremind"
"??????"))
+(define (play-click-sound)
+ (audio-play (asset-ref click-sound)))
+
+(define (play-key-press-sound)
+ (audio-play (asset-ref key-press-sound)))
+
+(define (play-device-sound)
+ (audio-play (asset-ref device-sound)))
+
(define-method (reset-game (game <game>))
(set! (subject-name-known? game) #f)
(set! (has-fridge-key? game) #f)
@@ -166,7 +183,8 @@
(set! (click-channel game) (make-channel))
(set! (terminal-locked? game) #t)
(set! (terminal-channel game) (make-channel))
- (set! (terminal-lines game) (make-ring-buffer 17)))
+ (set! (terminal-lines game) (make-ring-buffer 17))
+ (set! (key-pad-locked? game) #t))
(define-method (reboot (game <game>))
(reset-game game)
@@ -179,6 +197,7 @@
(lambda (widget button)
(if (eq? button 'left)
(begin
+ (play-click-sound)
(run-script node (proc))
#t)
#f)))
@@ -193,6 +212,7 @@
(()
(set! (state game) 'dialog)
(channel-get (click-channel game))
+ (play-click-sound)
(detach c)
(set! (state game) old-state)
#t)
@@ -224,6 +244,7 @@
choices)))))
(attach-to game choice-container)
(let ((choice (channel-get choice-channel)))
+ (play-click-sound)
(detach choice-container)
(detach c)
(set! (state game) old-state)
@@ -425,8 +446,26 @@
(exit-term))
(("diagnostic" level)
(diagnostic level))
+ (("door" "status")
+ (log "door: locked")
+ (if (key-pad-locked? game)
+ (log "key pad: locked")
+ (log "key pad: unlocked"))
+ #t)
+ (("door" "unlock")
+ (when (key-pad-locked? game)
+ (log "authenticating...")
+ (refresh-output #f)
+ (sleep 30)
+ (log "user access granted")
+ (log "key pad activated"))
+ (log "input PIN to complete unlock sequence")
+ (log "user hint: circumference to diameter ratio")
+ (set! (key-pad-locked? game) #f)
+ #t)
(("vent" "status")
- (log "off"))
+ (log "off")
+ #t)
(("vent" "toggle")
(if (eq? (cartridge game) 'in-control-panel)
(begin
@@ -464,7 +503,9 @@
(log "login"))
(refresh-output)
(let loop ()
- (if (match (channel-get (terminal-channel game))
+ (if (match (let ((key (channel-get (terminal-channel game))))
+ (play-key-press-sound)
+ key)
('backspace
(set! input (substring input 0 (max (- (string-length input) 1) 0)))
#t)
@@ -518,12 +559,9 @@ assignment. My colleagues find it
honestly prefer taking notes this
way.
-If someone is reading this: Sorry
-but I've signed too many NDAs to
-take any chances with naming
-actual people and places.
-
-;)"
+This project is big. It will be a
+career defining achievement if it
+is successful."
"Week 1
Subject has awoken and is slowly
@@ -640,32 +678,30 @@ Then I wake up."
"Week 7
It's clear what is happening now.
-The subject has transcended my
-interface and is communicating
-with me directly. How do I know?
-I was staring at the control panel
-and a thought came to me:
-\"<writeme>\"
-
-I didn't think that thought! It
-was injected! It's theoretically
+The subject has transcended our
+interface and is injecting
+thoughts directly into my
+consciousness. It's theoretically
possible, but the isochamber
blocks all signals except for the
-terminal interface. Did I make a
-mistake? I need to turn this
-around fast."
+terminal interface. The only good
+news is that it appears incapable
+of reading my own thoughts.
+
+Did I make a fatal mistake? I
+need to turn this around fast."
"Week 8
I've failed. It's all over. The
Directors shut it down. A member
of the medical team removed a
-small cartridge from the medical
+small cartridge from the
refrigerator, inserted it into the
-control panel, and activated the
-ventilation system via the
-terminal. Subject's pulse
-flatlined within minutes. I've
-been given some time to pack up.
+control panel, and typed some
+command into the terminal.
+Subject's pulse flatlined within
+minutes. I've been given some
+time alone to pack up.
I may be a failure but shouldn't I
feel better with that thing out of
@@ -749,6 +785,57 @@ diz--"))
(detach (& game notebook-group))
(set! (state game) old-state)))
+(define (control-panel game)
+ (let ((old-state (state game)))
+ (set! (state game) 'control-panel)
+ (attach-to game
+ (make <sprite>
+ #:name 'background
+ #:texture darkness))
+ (case (dialog game player-display-name
+ "> It's a control panel. What do you want to inspect?"
+ '(("Key pad" key-pad)
+ ("Receptacle" receptacle)
+ ("Nothing" nothing)))
+ ((key-pad)
+ (dialog game player-display-name
+ "> There's a key pad above an electronically locked tray.")
+ (when (dialog game player-display-name
+ "> Enter a code?"
+ '(("Yes" #t)
+ ("No" #f)))
+ (let ((g (& game explore-group)))
+ (detach g)
+ (if (string=? (pin-entry game) "181816")
+ (begin
+ (attach-to game g)
+ (dialog game player-display-name
+ "> It worked! The tray below opens to reveal a key inside.")
+ (dialog game player-display-name
+ "> You put the key in your pocket.")
+ (set! (has-fridge-key? game) #t))
+ (begin
+ (attach-to game g)
+ (dialog game player-display-name
+ "> Hmm, that wasn't right."))))))
+ ((receptacle)
+ (if (eq? (cartridge game) 'in-hand)
+ (begin
+ (dialog game player-display-name
+ "> There's an opening that is the same size as the cartridge you took from the
+refrigerator.")
+ (when (dialog game player-display-name
+ "> Do you want to insert the cartridge?"
+ '(("Yes" #t)
+ ("No" #f)))
+ (dialog game player-display-name "> You insert the cartridge.")
+ (set! (cartridge game) 'in-control-panel)))
+ (dialog game player-display-name
+ "> There's an opening where something can be plugged in, but you're not sure
+what."))))
+ (detach (& game background))
+ (set! (state game) old-state)))
+
(define-method (explore (game <game>))
(define (tint-all color)
(set! (tint (& game explore-group room-background)) color)
@@ -773,16 +860,19 @@ diz--"))
(good-ending game)
(bad-ending-1 game))))
(define (open-door)
- (let ((g (& game explore-group)))
- (detach g)
- (if (string=? (pin-entry game) "314159")
- (begin
- (attach-to game g)
- (end-game))
- (begin
- (attach-to game g)
- (dialog game player-display-name
- "> Hmm, no luck.")))))
+ (if (key-pad-locked? game)
+ (dialog game player-display-name
+ "> The key pad doesn't seem to be working.")
+ (let ((g (& game explore-group)))
+ (detach g)
+ (if (string=? (pin-entry game) "314159")
+ (begin
+ (attach-to game g)
+ (end-game))
+ (begin
+ (attach-to game g)
+ (dialog game player-display-name
+ "> Hmm, no luck."))))))
(define (inspect-door)
(if (opened-notebook? game)
(begin
@@ -816,47 +906,10 @@ useful to you.")
(terminal game)
(attach-to game g)))
(define (open-control-panel)
- (case (dialog game player-display-name
- "> It's a control panel. What do you want to inspect?"
- '(("Key pad" key-pad)
- ("Receptacle" receptacle)
- ("Nothing" nothing)))
- ((key-pad)
- (dialog game player-display-name
- "> There's a key pad above an electronically locked tray.")
- (when (dialog game player-display-name
- "> Enter a code?"
- '(("Yes" #t)
- ("No" #f)))
- (let ((g (& game explore-group)))
- (detach g)
- (if (string=? (pin-entry game) "181816")
- (begin
- (attach-to game g)
- (dialog game player-display-name
- "> It worked! The tray below opens to reveal a key inside.")
- (dialog game player-display-name
- "> You put the key in your pocket.")
- (set! (has-fridge-key? game) #t))
- (begin
- (attach-to game g)
- (dialog game player-display-name
- "> Hmm, that wasn't right."))))))
- ((receptacle)
- (if (eq? (cartridge game) 'in-hand)
- (begin
- (dialog game player-display-name
- "> There's an opening that is the same size as the cartridge you took from the
-refrigerator.")
- (when (dialog game player-display-name
- "> Do you want to insert the cartridge?"
- '(("Yes" #t)
- ("No" #f)))
- (dialog game player-display-name "> You insert the cartridge.")
- (set! (cartridge game) 'in-control-panel)))
- (dialog game player-display-name
- "> There's an opening where something can be plugged in, but you're not sure
-what.")))))
+ (let ((g (& game explore-group)))
+ (detach g)
+ (control-panel game)
+ (attach-to game g)))
(define (open-fridge)
(if (has-fridge-key? game)
(begin
@@ -925,6 +978,11 @@ if you would just open the door.")
(detach g)
(notebook game)
(attach-to game g)))
+ (define (run-on-left-click* game proc)
+ (run-on-left-click game
+ (lambda ()
+ (play-device-sound)
+ (proc))))
(attach-to game
(make <widget>
#:name 'explore-group
@@ -938,49 +996,51 @@ if you would just open the door.")
#:texture door-lock-texture
#:position (vec2 586.0 196.0)
#:listeners
- `((click . ,(run-on-left-click game open-door))))
+ `((click . ,(run-on-left-click* game open-door))))
(make <device>
#:name 'door
#:rank 1
#:texture door-texture
#:position (vec2 445.0 40.0)
#:listeners
- `((click . ,(run-on-left-click game inspect-door))))
+ `((click . ,(run-on-left-click* game inspect-door))))
(make <device>
#:name 'control-panel
#:rank 1
#:texture control-panel-texture
#:position (vec2 230.0 40.0)
#:listeners
- `((click . ,(run-on-left-click game open-control-panel))))
+ `((click . ,(run-on-left-click* game open-control-panel))))
(make <device>
#:name 'fridge
#:rank 1
#:texture fridge-texture
#:position (vec2 0.0 40.0)
#:listeners
- `((click . ,(run-on-left-click game open-fridge))))
+ `((click . ,(run-on-left-click* game open-fridge))))
(make <device>
#:name 'notebook
#:rank 1
#:texture notebook-texture
#:position (vec2 14.0 159.0)
#:listeners
- `((click . ,(run-on-left-click game open-notebook))))
+ `((click . ,(run-on-left-click* game open-notebook))))
(make <device>
#:name 'window
#:rank 1
#:texture window-texture
#:position (vec2 112.0 197.0)
#:listeners
- `((click . ,(run-on-left-click game inspect-window))))
+ `((click . ,(run-on-left-click* game inspect-window))))
(make <device>
#:name 'terminal
#:rank 1
#:texture terminal-texture
#:position (vec2 109.0 40.0)
#:listeners
- `((click . ,(run-on-left-click game open-terminal)))))))
+ `((click . ,(run-on-left-click* game open-terminal)))))))
+ (set-source-audio! (audio-source game) (asset-ref background-music))
+ (source-play (audio-source game))
(fade-in))
(define-method (good-ending (game <game>))
@@ -1047,6 +1107,8 @@ time?")
(set! (text (& game credits)) line)
(sleep 120))
(set! (state game) 'credits)
+ (set-source-audio! (audio-source game) (asset-ref credits-music))
+ (source-play (audio-source game))
(attach-to game
(make <sprite>
#:name 'background
@@ -1060,16 +1122,20 @@ time?")
#:position (vec2 (/ game-width 2.0) (/ game-height 2.0))))
(sleep 60)
(credit "The Test Subject")
- (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")
+ (credit "developed by David Thompson (GPLv3) 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")
+ (credit "UI sounds by Kenney (CC0) https://opengameart.org/content/51-ui-sound-effects-buttons-switches-and-clicks")
+ (credit "background music by brandon75689 (CC0) https://opengameart.org/content/tragic-ambient-main-menu")
+ (credit "credits music by tcarisland (CC-BY 4.0) https://opengameart.org/content/the-end")
(if (>= (friendship game) 3)
(credit "congratulations on reaching the true ending!")
(credit "the true ending still awaits you..."))
(credit "click to play again")
(set! (first-playthrough? game) #f)
(channel-get (click-channel game))
+ (play-click-sound)
(tween 120 white black
(lambda (color)
(set! (tint (& game background)) color))
@@ -1141,7 +1207,7 @@ time?")
(define (launch-game)
(boot-kernel (make <kernel>
#:window-config (make <window-config>
- #:title "Spring Lisp Game Jam 2021"
+ #:title "The Test Subject - Spring Lisp Game Jam 2021"
#:width window-width
#:height window-height))
(lambda () (make <game>))))