From: Javier Sancho Date: Sat, 29 Apr 2017 15:20:43 +0000 (+0200) Subject: New module for reactive and rate based behaviour X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=14ad65d046d9644500d12afac6de707cb3d52239;p=gacela.git New module for reactive and rate based behaviour --- diff --git a/gacela.scm b/gacela.scm index 2ed1e6a..d0484bf 100644 --- a/gacela.scm +++ b/gacela.scm @@ -26,6 +26,7 @@ (gacela image) (gacela game) (gacela math) + (gacela react) (gacela scene) (gacela window))) diff --git a/gacela/react.scm b/gacela/react.scm new file mode 100644 index 0000000..e9d0668 --- /dev/null +++ b/gacela/react.scm @@ -0,0 +1,39 @@ +;;; Gacela, a GNU Guile extension for fast games development +;;; Copyright (C) 2017 by Javier Sancho Fernandez +;;; +;;; This program is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see . + + +(define-module (gacela react) + #:use-module (gacela scene) + #:export (context + at-rate)) + +(define-syntax context + (syntax-rules () + ((_ ((variable value) + ...) + scene) + (make-scene + "context" + (let* ((variable value) + ...) + (lambda () + (begin + (set! variable value) + ...) + (display-scene scene))))))) + +(define (at-rate value) + 0)