diff options
Diffstat (limited to 'examples/simple.scm')
-rw-r--r-- | examples/simple.scm | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/examples/simple.scm b/examples/simple.scm index 0f3760b..f1882b7 100644 --- a/examples/simple.scm +++ b/examples/simple.scm @@ -15,27 +15,16 @@ ;;; along with this program. If not, see ;;; <http://www.gnu.org/licenses/>. -(use-modules (sly game) - (sly window) - (sly utils) - (sly signal) - (sly math rect) - (sly math vector) - (sly render) - (sly render camera) - (sly render color) - (sly render shader) - (sly render sprite) - (sly render texture)) +(use-modules (sly)) (load "common.scm") -(define sprite (load-sprite "images/p1_front.png")) - (define-signal scene - (with-camera (2d-camera #:area (make-rect 0 0 640 480)) - (move (vector2 320 240) - (render-sprite sprite)))) + (signal-let ((sprite (on-start (load-sprite "images/p1_front.png") + null-sprite))) + (with-camera (2d-camera #:area (make-rect 0 0 640 480)) + (move (vector2 320 240) + (render-sprite sprite))))) (with-window (make-window #:title "Simple Sprite Demo") (run-game-loop scene)) |