summaryrefslogtreecommitdiff
path: root/bonnie-bee/common.scm
blob: fa9f14a192a17541a53f23f70a0f76eee0ab5ceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)))))