diff options
author | henriquelalves <henriquelalves@gmail.com> | 2024-05-15 11:29:28 +0300 |
---|---|---|
committer | henriquelalves <henriquelalves@gmail.com> | 2024-05-15 11:29:28 +0300 |
commit | 0a89a84956311f17648bb443e429dab25d35f0cc (patch) | |
tree | 00640cdc6f0cf717d7cf5ef7a659d91887a708f1 /scripts/main.scm | |
parent | 9859882f9f37f3eee6f9b90348c7e3c2ed229c49 (diff) | |
download | gamejam-slgj-2024-0a89a84956311f17648bb443e429dab25d35f0cc.tar.gz gamejam-slgj-2024-0a89a84956311f17648bb443e429dab25d35f0cc.tar.bz2 gamejam-slgj-2024-0a89a84956311f17648bb443e429dab25d35f0cc.zip |
removed skeleton repl
Diffstat (limited to 'scripts/main.scm')
-rw-r--r-- | scripts/main.scm | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/scripts/main.scm b/scripts/main.scm index af6b550..5dcbe10 100644 --- a/scripts/main.scm +++ b/scripts/main.scm @@ -4,29 +4,37 @@ (load "./scripts/gol.scm") (define camera-offset (make-point)) +(define space-pressed #f) (define (update) - ;; (prompt-update) ;; it's eating the input! - (if (rl-is-key-down KEY_DOWN) - (set! (point-y camera-offset) (+ (point-y camera-offset) 2)) - ) - - (if (rl-is-key-down KEY_UP) - (set! (point-y camera-offset) (+ (point-y camera-offset) -2)) - ) - - (if (rl-is-key-down KEY_LEFT) - (set! (point-x camera-offset) (+ (point-x camera-offset) -2)) - ) - - (if (rl-is-key-down KEY_RIGHT) - (set! (point-x camera-offset) (+ (point-x camera-offset) 2)) - ) - - (if (eq? (rl-get-key-pressed) KEY_SPACE) - (run-step) - ) - + (prompt-update) + + (cond ((not prompt-active) + (if (rl-is-key-down KEY_DOWN) + (set! (point-y camera-offset) (+ (point-y camera-offset) 2)) + ) + + (if (rl-is-key-down KEY_UP) + (set! (point-y camera-offset) (+ (point-y camera-offset) -2)) + ) + + (if (rl-is-key-down KEY_LEFT) + (set! (point-x camera-offset) (+ (point-x camera-offset) -2)) + ) + + (if (rl-is-key-down KEY_RIGHT) + (set! (point-x camera-offset) (+ (point-x camera-offset) 2)) + ) + + (cond ((and (rl-is-key-down KEY_SPACE) (not space-pressed)) + (set! space-pressed #t) + (run-step)) + ) + + (if (not (rl-is-key-down KEY_SPACE)) + (set! space-pressed #f) + ) + )) ) (define (draw) |