aboutsummaryrefslogtreecommitdiff
path: root/docs/guide.org
diff options
context:
space:
mode:
Diffstat (limited to 'docs/guide.org')
-rw-r--r--docs/guide.org10
1 files changed, 4 insertions, 6 deletions
diff --git a/docs/guide.org b/docs/guide.org
index 1c5a8f3..96663ea 100644
--- a/docs/guide.org
+++ b/docs/guide.org
@@ -101,7 +101,8 @@ Now let's add an entity you can move with the keyboard. Create =square.scm=:
(entity-ref box #:vx 0))))
(box (entity-set box #:y (+ (entity-ref box #:y 0)
(entity-ref box #:vy 0)))))
- (scene-entities-set! scene (list box))))
+ (game-scene-set! game
+ (update-scene scene entities: (list box)))))
render: (lambda (game)
(let* ((scene (game-scene game))
@@ -194,11 +195,8 @@ For a real game, you probably want tilemaps, gravity, and collision detection. D
(player (apply-velocity-y player))
(player (resolve-tile-collisions-y player tm))
(player (detect-on-solid player tm)))
- ;; Update camera to follow player
- (let ((cam-x (max 0 (- (entity-ref player #:x 0) 300))))
- (camera-x-set! (scene-camera scene) cam-x))
- ;; Replace entities in scene
- (scene-entities-set! scene (list player))))))
+ (game-scene-set! game
+ (update-scene scene entities: (list player)))))))
(game-run! *game*)
#+end_src