summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README27
1 files changed, 13 insertions, 14 deletions
diff --git a/README b/README
index fe201d8..b478a57 100644
--- a/README
+++ b/README
@@ -29,21 +29,22 @@ Sly differentiates itself from most other game engines by encouraging
#+BEGIN_SRC scheme
(use-modules (sly))
- ;; Create OpenGL context and do other setup.
- (sly-init)
-
- ;; Load a GNU head sprite.
- (define gnu
- (load-sprite "gnu.png"))
-
;; The way we see the world.
(define camera
(2d-camera #:area (make-rect 0 0 640 480)))
+ ;; Load a GNU head sprite when the game starts. Until the game
+ ;; starts, this "signal" holds the null sprite.
+ (define-signal gnu
+ (on-start (load-sprite "gnu.png")
+ null-sprite))
+
;; View the sprite from the perspective of the camera.
(define-signal scene
- (with-camera camera
- (move (vector2 320 240) (render-sprite gnu))))
+ (signal-let ((gnu gnu))
+ (with-camera (2d-camera #:area (make-rect 0 0 640 480))
+ (move (vector2 320 240)
+ (render-sprite gnu)))))
(with-window (make-window #:title "Hello, world!")
(run-game-loop scene))
@@ -70,7 +71,7 @@ Sly differentiates itself from most other game engines by encouraging
#+BEGIN_SRC scheme
(with-window (make-window #:title "Best Game Ever"
#:resolution #(640 480))
- (run-game-loop))
+ (run-game-loop scene))
#+END_SRC
** Functional Reactive Programming
@@ -160,8 +161,7 @@ Sly differentiates itself from most other game engines by encouraging
#+BEGIN_SRC sh
guix environment -l guix.scm
- ./bootstrap && ./configure \
- --with-libgslcblas-prefix=$(guix build gsl)
+ ./bootstrap && ./configure
#+END_SRC
* Running Examples
@@ -193,10 +193,9 @@ Sly differentiates itself from most other game engines by encouraging
* Dependencies
- - GNU Guile >= 2.0.11
+ - GNU Guile >= 2.0.11 (Guile 2.2.x recommended for best performance)
- [[http://www.gnu.org/software/guile-opengl/][guile-opengl]] >= 0.1.0
- [[https://dthompson.us/pages/software/guile-sdl2.html][guile-sdl2]] >= 0.1.0
- - GNU Scientific Library (GSL)
* Releases