summaryrefslogtreecommitdiff
path: root/super-bloom
diff options
context:
space:
mode:
Diffstat (limited to 'super-bloom')
-rw-r--r--super-bloom/main.scm50
1 files changed, 50 insertions, 0 deletions
diff --git a/super-bloom/main.scm b/super-bloom/main.scm
new file mode 100644
index 0000000..2f49e9a
--- /dev/null
+++ b/super-bloom/main.scm
@@ -0,0 +1,50 @@
+;;; Copyright 2023 David Thompson
+;;;
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(define-module (super-bloom main)
+ #:use-module (catbird)
+ #:use-module (catbird asset)
+ #:use-module (catbird camera)
+ #:use-module (catbird kernel)
+ #:use-module (catbird node)
+ #:use-module (catbird node-2d)
+ #:use-module (catbird region)
+ #:use-module (catbird scene)
+ #:use-module (chickadee)
+ #:use-module (chickadee math vector)
+ #:use-module (chickadee graphics sprite)
+ #:use-module (chickadee graphics texture)
+ #:use-module (oop goops)
+ #:export (launch-game))
+
+(define %default-width 1366)
+(define %default-height 768)
+
+(define-asset (chickadee-texture (file "assets/images/chickadee.png"))
+ (load-image file))
+
+(define (init)
+ (let ((region (create-full-region #:name 'main))
+ (scene (make <scene> #:name 'super-bloom)))
+ (replace-scene region scene)
+ (set-camera region (make <camera-2d>))
+ (attach-to scene (make <sprite>
+ #:name 'chickadee
+ #:texture chickadee-texture))
+ (center-in-parent (& scene chickadee))))
+
+(define (launch-game)
+ (run-catbird init
+ #:width %default-width
+ #:height %default-height))