2024-05-18 17:02:38 +00:00
|
|
|
#|-----------------------------------------|
|
|
|
|
| Entry for the Spring Lisp Game Jam 2024 |
|
2024-05-21 18:58:22 +00:00
|
|
|
| Title: Prok |
|
2024-05-18 17:02:38 +00:00
|
|
|
| Genre: Procedural text adventure |
|
|
|
|
| Author: kiefac (homie@tensi.org) |
|
|
|
|
| Start date: 2024-18-5 |
|
|
|
|
| End date: <TODO> |
|
|
|
|
|-----------------------------------------|#
|
2024-05-18 16:11:50 +00:00
|
|
|
#lang racket/gui
|
|
|
|
(require racket/gui/easy
|
|
|
|
racket/gui/easy/operator)
|
2024-05-21 17:19:59 +00:00
|
|
|
(require "interpret.rkt")
|
2024-05-18 16:11:50 +00:00
|
|
|
|
|
|
|
(define mono (send the-font-list find-or-create-font 12 'modern 'normal 'normal))
|
2024-05-21 17:19:59 +00:00
|
|
|
(define/obs @log "You awake in a dark room.\n")
|
2024-05-18 16:11:50 +00:00
|
|
|
(define/obs @input "Type here...")
|
|
|
|
|
|
|
|
(define (text-entered event content)
|
|
|
|
(when (eqv? event 'return)
|
2024-05-21 17:19:59 +00:00
|
|
|
(:= @input "")
|
|
|
|
(let ([input (string-upcase content)])
|
|
|
|
(:= @log (~a (obs-peek @log) "> " input "\n" (interpret input) "\n")))))
|
2024-05-18 16:11:50 +00:00
|
|
|
|
|
|
|
(render
|
|
|
|
(window
|
2024-05-21 18:58:22 +00:00
|
|
|
#:title "Prok"
|
2024-05-18 16:11:50 +00:00
|
|
|
(hpanel
|
|
|
|
(vpanel
|
|
|
|
(input @log
|
|
|
|
#:enabled? #f
|
|
|
|
#:style '(multiple)
|
|
|
|
#:min-size '(600 400)
|
|
|
|
#:font mono)
|
|
|
|
(input @input
|
|
|
|
text-entered
|
|
|
|
#:enabled? #t
|
|
|
|
#:style '(single)
|
|
|
|
#:font mono))
|
|
|
|
(vpanel
|
|
|
|
))))
|