[feat] move left

This commit is contained in:
SouthFox 2024-05-26 22:54:41 +08:00
parent f06e510505
commit 8412883500

View file

@ -122,11 +122,12 @@
(cond (cond
((string=? key key:left) ((string=? key key:left)
(dprint "key:" key) (dprint "key:" key)
(collide-gelement! (- (car (parentheses-pos (level-left-parenthes *level*))) 1) (cdr (parentheses-pos (level-left-parenthes *level*))) (level-left-parenthes *level*))
(set! *element-x* (- *element-x* 10))) (set! *element-x* (- *element-x* 10)))
((string=? key key:right) ((string=? key key:right)
(dprint "key:" key) (dprint "key:" key)
(set! *element-x* (+ *element-x* 10)) (set! *element-x* (+ *element-x* 10))
(collide-gelement! (+ 1 (car (parentheses-pos (level-left-parenthes *level*)))) (cdr (parentheses-pos (level-left-parenthes *level*))) (level-left-parenthes *level*)) (collide-gelement! (+ (car (parentheses-pos (level-left-parenthes *level*))) 1) (cdr (parentheses-pos (level-left-parenthes *level*))) (level-left-parenthes *level*))
)))) ))))
(add-event-listener! (current-document) "keydown" (add-event-listener! (current-document) "keydown"