summaryrefslogtreecommitdiff
path: root/bonnie-bee/splash.scm
diff options
context:
space:
mode:
Diffstat (limited to 'bonnie-bee/splash.scm')
-rw-r--r--bonnie-bee/splash.scm38
1 files changed, 37 insertions, 1 deletions
diff --git a/bonnie-bee/splash.scm b/bonnie-bee/splash.scm
index 0c2a507..292fd05 100644
--- a/bonnie-bee/splash.scm
+++ b/bonnie-bee/splash.scm
@@ -1,5 +1,41 @@
(define-module (bonnie-bee splash)
+ #:use-module (bonnie-bee assets)
+ #:use-module (bonnie-bee common)
+ #:use-module (bonnie-bee game)
+ #:use-module (chickadee graphics color)
+ #:use-module (chickadee math vector)
+ #:use-module (chickadee scripting)
+ #:use-module (oop goops)
+ #:use-module (starling kernel)
+ #:use-module (starling node)
+ #:use-module (starling node-2d)
+ #:use-module (starling scene)
#:export (launch-game))
+(define-class <splash> (<scene-2d>))
+
+(define-method (on-boot (splash <splash>))
+ (set-cameras! splash)
+ (attach-to splash
+ (make <label>
+ #:name 'label
+ #:font chonkly-font
+ #:color black
+ #:align 'center
+ #:vertical-align 'center
+ #:position (vec2 (/ %game-width 2.0) (/ %game-height 2.0)))))
+
+(define-method (on-enter (splash <splash>))
+ (unless (getenv "SKIP_SPLASH")
+ (run-script splash
+ (set! (text (& splash label)) "made with chickadee")
+ (sleep 30)
+ (replace-scene (current-kernel) (make <game>)))))
+
(define (launch-game)
- (display "hi I don't do anything yet!\n"))
+ (boot-kernel (make <kernel>
+ #:window-config (make <window-config>
+ #:title "Bonnie Bee and the Pesticidal Tendencies - Autumn Lisp Game Jam 2021"
+ #:width %window-width
+ #:height %window-height))
+ (lambda () (make <splash>))))