From 8c11779c29d94a8c7702aae0964180252638dc10 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Tue, 15 May 2012 21:02:06 +0200 Subject: [PATCH] Guybrush moves with cursors left and right --- games/guybrush/guybrush.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/games/guybrush/guybrush.scm b/games/guybrush/guybrush.scm index 967c4de..66e58e3 100644 --- a/games/guybrush/guybrush.scm +++ b/games/guybrush/guybrush.scm @@ -10,10 +10,14 @@ (define-mob (guybrush (guy (load-texture "guybrush.png")) (x 0) - (y (- (/ (assoc-ref (get-game-properties) 'height) 2)))) + (y (+ (- (/ (assoc-ref (get-game-properties) 'height) 2)) + (/ (assoc-ref (get-texture-properties guy) 'height) 2)))) + + (cond ((key? 'left) (set! x (- x 10)))) + (cond ((key? 'right) (set! x (+ x 10)))) + (translate x y) (draw-texture guy)) (show-mob (guybrush)) -;; Tengo que hacer una función para obtener propiedades de textura en video.scm \ No newline at end of file -- 2.39.2