diff options
author | Henrique Alves <henrique.alves@itsjungle.xyz> | 2024-04-26 14:53:39 +0300 |
---|---|---|
committer | Henrique Alves <henrique.alves@itsjungle.xyz> | 2024-04-26 14:53:39 +0300 |
commit | 526f281cc2d1da11d0104de510c5bc301f605ddd (patch) | |
tree | 562239298eacaa68028b8871816ed7e3c738bab0 /scripts | |
parent | d7cd1276f9842e6eb50dca16978a99d4fe7bbdaa (diff) | |
download | gamejam-slgj-2024-526f281cc2d1da11d0104de510c5bc301f605ddd.tar.gz gamejam-slgj-2024-526f281cc2d1da11d0104de510c5bc301f605ddd.tar.bz2 gamejam-slgj-2024-526f281cc2d1da11d0104de510c5bc301f605ddd.zip |
update
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/keys.scm | 3 | ||||
-rw-r--r-- | scripts/main.scm | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/scripts/keys.scm b/scripts/keys.scm new file mode 100644 index 0000000..963fb41 --- /dev/null +++ b/scripts/keys.scm @@ -0,0 +1,3 @@ +(define KEY_RIGHT 262) +(define KEY_LEFT 263) +(define KEY_DOWN 264) diff --git a/scripts/main.scm b/scripts/main.scm index 095fa98..2507424 100644 --- a/scripts/main.scm +++ b/scripts/main.scm @@ -1,14 +1,16 @@ +(load "./scripts/keys.scm") + (define a 0) (define b (rl-load-texture)) (define (update) - (cond ((rl-is-key-down 262) (set! b (rl-load-texture))) ;; right - ((rl-is-key-down 263) (set! a (+ a 1))) ;; left - ((rl-is-key-down 264) (gc)) ;; down + (cond ((rl-is-key-down KEY_RIGHT) (set! b (rl-load-texture))) ;; right + ((rl-is-key-down KEY_LEFT) (set! a (+ a 1))) ;; left + ((rl-is-key-down KEY_DOWN) (gc)) ;; down ) ) (define (draw) (rl-draw-text (number->string a)) -; (rl-draw-texture b) + (rl-draw-texture b) ) |