mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
revisions
This commit is contained in:
parent
1444d1639b
commit
8e55e5b5ed
3 changed files with 7 additions and 4 deletions
|
|
@ -5,6 +5,8 @@
|
||||||
(defvar *x*) ; ball x
|
(defvar *x*) ; ball x
|
||||||
(defvar *y*) ; ball y
|
(defvar *y*) ; ball y
|
||||||
|
|
||||||
|
(defvar *max-x* (* (1- *width*) +w+))
|
||||||
|
|
||||||
(defun move (x-rotation y-rotation) ; called from QML
|
(defun move (x-rotation y-rotation) ; called from QML
|
||||||
(labels ((add (x)
|
(labels ((add (x)
|
||||||
(truncate (signum x)))
|
(truncate (signum x)))
|
||||||
|
|
@ -19,6 +21,7 @@
|
||||||
(dy (min (* 0.2 x-rotation) (1- +w+)))
|
(dy (min (* 0.2 x-rotation) (1- +w+)))
|
||||||
(add-x (add dx))
|
(add-x (add dx))
|
||||||
(add-y (add dy)))
|
(add-y (add dy)))
|
||||||
|
(setf *x* (min *x* *max-x*)) ; don't lose ball (initial x)
|
||||||
(if (aref *maze*
|
(if (aref *maze*
|
||||||
(+ add-x (to-pos *x*))
|
(+ add-x (to-pos *x*))
|
||||||
(to-pos *y*))
|
(to-pos *y*))
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
(set-visible x y (aref *maze* x y)))))
|
(set-visible x y (aref *maze* x y)))))
|
||||||
|
|
||||||
(defun new-maze ()
|
(defun new-maze ()
|
||||||
(setf *maze* (make-array (list (1+ *width*) (1+ *height*))
|
(setf *maze* (make-array (list *width* *height*)
|
||||||
:initial-element t))
|
:initial-element t))
|
||||||
(display-maze)
|
(display-maze)
|
||||||
(qlater 'generate-maze))
|
(qlater 'generate-maze))
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ development, the simple `-auto` option of `lqml run.lisp` may be more
|
||||||
appropriate, because it allows for re-initialization (calling Lisp code) after
|
appropriate, because it allows for re-initialization (calling Lisp code) after
|
||||||
reloading QML.*
|
reloading QML.*
|
||||||
|
|
||||||
*The above method also works on mobile, please see example `swank-server`. It
|
*The above method also works on mobile, please see example
|
||||||
doesn't depend on Swank, and should therefore also be stable (it uses a local
|
`advanced-qml-auto-realod`. It doesn't depend on Swank, and should therefore
|
||||||
trivial web server).*
|
also be stable (it uses a local trivial web server).*
|
||||||
|
|
||||||
*You may even run both desktop and (one or more) mobile device auto reloads
|
*You may even run both desktop and (one or more) mobile device auto reloads
|
||||||
simultaneously (`swank-server` example only), because they all watch/load the
|
simultaneously (`swank-server` example only), because they all watch/load the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue