diff options
Diffstat (limited to 'demo/topdown.scm')
| -rw-r--r-- | demo/topdown.scm | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/demo/topdown.scm b/demo/topdown.scm index 1bf6536..7fa9b7e 100644 --- a/demo/topdown.scm +++ b/demo/topdown.scm @@ -1,15 +1,13 @@ (import scheme (chicken base) + srfi-8 (only srfi-197 chain) (prefix sdl2 "sdl2:") (prefix sdl2-ttf "ttf:") (prefix sdl2-image "img:") downstroke-engine downstroke-world - downstroke-tilemap - downstroke-renderer downstroke-input - downstroke-physics downstroke-assets downstroke-entity downstroke-scene-loader) @@ -28,15 +26,9 @@ (+ (if (input-held? input 'up) -3 0) (if (input-held? input 'down) 3 0)))) -(define (update-player player input tm) +(define (update-player player input) (receive (dx dy) (input->velocity input) - (chain player - (entity-set _ #:vx dx) - (entity-set _ #:vy dy) - (apply-velocity-x _) - (resolve-tile-collisions-x _ tm) - (apply-velocity-y _) - (resolve-tile-collisions-y _ tm)))) + (entity-set (entity-set player #:vx dx) #:vy dy))) (define *game* (make-game @@ -51,8 +43,7 @@ update: (lambda (game dt) (let* ((input (game-input game)) (scene (game-scene game)) - (player (update-player (car (scene-entities scene)) - input (scene-tilemap scene)))) + (player (update-player (car (scene-entities scene)) input))) (game-scene-set! game (update-scene scene entities: (list player))))))) |
