summaryrefslogtreecommitdiff
path: root/strigoform/game-area.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2024-04-10 14:49:03 -0400
committerDavid Thompson <dthompson2@worcester.edu>2024-04-10 14:49:03 -0400
commit6696a0b5fcb1b17895285d80d9636defb2df3f9d (patch)
tree2cce306afcd7776925f725a382ae1a834513636c /strigoform/game-area.scm
parent20b4e7c566cd268f8fafd3e2d3846513e31949e7 (diff)
Sloppily refactor into modules.
Diffstat (limited to 'strigoform/game-area.scm')
-rw-r--r--strigoform/game-area.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/strigoform/game-area.scm b/strigoform/game-area.scm
new file mode 100644
index 0000000..7155813
--- /dev/null
+++ b/strigoform/game-area.scm
@@ -0,0 +1,15 @@
+(library (strigoform game-area)
+ (export game-width
+ game-height
+ out-of-bounds?)
+ (import (scheme base)
+ (strigoform math))
+
+ (define game-width 240.0)
+ (define game-height 320.0)
+
+ (define (out-of-bounds? x y w h)
+ (let ((padding 32.0))
+ (not (rect-within? x y w h (- padding) (- padding)
+ (+ game-width (* padding 2.0))
+ (+ game-height (* padding 2.0)))))))