From 4c0e431b1d09b0b961a764334bf58cada254922a Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 11 Aug 2016 22:47:54 -0400 Subject: Add declarative game specification type. * sly/game.scm (): New record type. (game, %game, game?, game-window, game-scene): New procedures. --- sly/game.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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? @@ -46,6 +52,17 @@ run-game-loop stop-game-loop)) + +;;; +;;; Game specification +;;; + +(define-record-type* + %game game + game? + (window game-window (make-window)) + (scene game-scene #f)) + ;;; ;;; Hooks and initializers -- cgit v1.2.3