summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-08-11 22:47:54 -0400
committerDavid Thompson <dthompson2@worcester.edu>2016-08-11 22:47:54 -0400
commit4c0e431b1d09b0b961a764334bf58cada254922a (patch)
tree7b05a9b0538c15f203a556d4dc26f4fec7ccb64c
parent1d75ed151a617c7cc734cb7483efcae85e295623 (diff)
Add declarative game specification type.
* sly/game.scm (<game>): New record type. (game, %game, game?, game-window, game-scene): New procedures.
-rw-r--r--sly/game.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/sly/game.scm b/sly/game.scm
index 66f0893..d4e6a2c 100644
--- a/sly/game.scm
+++ b/sly/game.scm
@@ -37,7 +37,13 @@
#:use-module (sly math vector)
#:use-module (sly window)
#:use-module (sly render)
- #:export (game-start-hook
+ #:use-module (sly records)
+ #:export (game
+ game?
+ game-window
+ game-scene
+
+ game-start-hook
draw-hook
after-game-loop-error-hook
game-started?
@@ -48,6 +54,17 @@
;;;
+;;; Game specification
+;;;
+
+(define-record-type* <game>
+ %game game
+ game?
+ (window game-window (make-window))
+ (scene game-scene #f))
+
+
+;;;
;;; Hooks and initializers
;;;