summaryrefslogtreecommitdiff
path: root/bonnie-bee/common.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2021-10-15 23:29:49 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2021-10-15 23:29:49 -0400
commit58266627bf3ea66dfc6f8434c32304758d1d9e98 (patch)
tree2f398d7cc9230250f5d11abece2e9e8ae0f05dd8 /bonnie-bee/common.scm
parenta2b03f564d1eb66298c5502b07e36c67f856857e (diff)
Day 1 check-in.
Diffstat (limited to 'bonnie-bee/common.scm')
-rw-r--r--bonnie-bee/common.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/bonnie-bee/common.scm b/bonnie-bee/common.scm
new file mode 100644
index 0000000..fa9f14a
--- /dev/null
+++ b/bonnie-bee/common.scm
@@ -0,0 +1,24 @@
+(define-module (bonnie-bee common)
+ #:use-module (chickadee graphics color)
+ #:use-module (chickadee graphics viewport)
+ #:use-module (chickadee math vector)
+ #:use-module (oop goops)
+ #:use-module (starling scene)
+ #:use-module (starling node-2d)
+ #:export (%window-width
+ %window-height
+ %game-width
+ %game-height
+ set-cameras!))
+
+(define %window-width 960)
+(define %window-height 720)
+(define %game-width 320)
+(define %game-height 240)
+
+(define-method (set-cameras! (scene <scene-2d>))
+ (set! (cameras scene)
+ (list (make <camera-2d>
+ #:resolution (vec2 %game-width %game-height)
+ #:viewport (make-viewport 0 0 %window-width %window-height
+ #:clear-color black)))))