diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-08 10:13:16 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-08 10:13:16 -0500 |
commit | 7bf212df6c3cf0d16b7145ddb18b97f504717230 (patch) | |
tree | 51fc74e31f577884c6ec09e64a97f309832a6df2 | |
parent | 9106f3adb796f2c7fb0127fb8e0a66799a214c9b (diff) |
[add] exports to pacage; [rename] frameset-key/sprite-frameset-key
-rw-r--r-- | examples/06-sprite.lisp | 7 | ||||
-rw-r--r-- | examples/08-pong.lisp | 2 | ||||
-rw-r--r-- | src/interactive/button.lisp | 2 | ||||
-rw-r--r-- | src/interactive/sprite.lisp | 4 | ||||
-rw-r--r-- | src/package.lisp | 82 |
5 files changed, 88 insertions, 9 deletions
diff --git a/examples/06-sprite.lisp b/examples/06-sprite.lisp index 2addfd7..abb5043 100644 --- a/examples/06-sprite.lisp +++ b/examples/06-sprite.lisp @@ -14,9 +14,9 @@ (defun set-key-if-not (sprite key ) "Sets the frame kyey for sprite if that key is not already set. Also sets the frameset's RUNNINGP to T if it is not already." - (unless (eql key (ww::frameset-key sprite)) + (unless (eql key (ww::sprite-frameset-key sprite)) (setf (ww::runningp (ww::current-frameset sprite)) nil) - (setf (ww::frameset-key sprite) key)) + (setf (ww::sprite-frameset-key sprite) key)) (unless (ww::runningp (ww::current-frameset sprite)) (setf (ww::runningp (ww::current-frameset sprite)) t))) @@ -27,7 +27,7 @@ "When the sprite is walking, adjust its position." (with-slots (walkingp walking-speed) sprite (when walkingp - (case (ww::frameset-key sprite) + (case (ww::sprite-frameset-key sprite) (:left (decf (ww::x sprite) walking-speed)) (:right @@ -71,7 +71,6 @@ (setf (ww::runningp current) nil (ww::frameset-index current) 0)))) - (defmethod ww::boot ((app sprite-example)) (let* ((front (ww::make-frameset diff --git a/examples/08-pong.lisp b/examples/08-pong.lisp index eae6843..51de28d 100644 --- a/examples/08-pong.lisp +++ b/examples/08-pong.lisp @@ -121,7 +121,7 @@ on which boundary VAL is outside of." (ww::defhandler pong-mousemove (ww::on-mousemotion (app) "Just sets the position of the paddle, and updates the paddles dx" - (setf (ww::x (paddle app)) + (setf (ww::x (paddle app)) (- x (* 0.5 (ww::width (paddle app)))) ;; using dx to store some motion informaton ;; used to chagne dx and dr in the ball diff --git a/src/interactive/button.lisp b/src/interactive/button.lisp index 08f7f37..0a15d79 100644 --- a/src/interactive/button.lisp +++ b/src/interactive/button.lisp @@ -7,7 +7,7 @@ :std (error "UP and DOWN lots are required") :doc "Any affine renderable unit") (bg :with) - (on-press on-release :doc "Function accepting the button.")) + (on-press on-release :with :doc "Function accepting the button.")) (:documentation "A basic button class. The UP and DOWN slots should be filled with renderable objects having the same size.")) diff --git a/src/interactive/sprite.lisp b/src/interactive/sprite.lisp index 03bba8d..e478d37 100644 --- a/src/interactive/sprite.lisp +++ b/src/interactive/sprite.lisp @@ -4,11 +4,11 @@ (defclass/std sprite (unit interactive) ((framesets :with :doc "A PLIST whose values are framesets.") - (frameset-key))) + (frameset-key :with))) (defun current-frameset (sprite) (getf (sprite-framesets sprite) - (frameset-key sprite))) + (sprite-frameset-key sprite))) (defmethod initialize-instance :after ((sprite sprite) &key) (with-slots (framesets frameset-key) sprite diff --git a/src/package.lisp b/src/package.lisp index 5a59057..dc18ef4 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -7,4 +7,84 @@ (#:vec #:3d-vectors)) (:import-from #:defclass-std #:defclass/std) (:import-from #:alexandria - #:when-let #:when-let* #:if-let)) + #:when-let #:when-let* #:if-let) + (:export + #:add-handler + #:add-unit + #:application + #:asset-root + #:asset-classifiers + #:appplication-scale + #:application-width + #:application-height + #:application-window + #:refocus-on-mousedown-p + #:application-focus + #:fps + #:bitmap + #:boot + #:button + #:button-up + #:button-down + #:button-bg + #:button-on-press + #:button-on-release + #:container + #:container-left + #:container-right + #:container-top + #:container-bottom + #:container-units + #:current-frameset + #:defhandler + #:drop-unit + #:frameset-index + #:frameset-key + #:get-asset + #:get-focus + #:make-frameset + #:on-after-added + #:on-before-added + #:on-before-dropped + #:on-blur + #:on-focus + #:on-keydown + #:on-keyup + #:on-mousedown + #:on-mousemotion + #:on-mousewheel + #:on-perframe + #:radians + #:refocus-on + #:remove-handler + #:runningp + #:shutdown + #:sprite + #:sprite-frameset + #:sprite-frameset-key + #:start + #:text + #:text-color + #:unit-container + #:unit-visbilep + #:units-intersect-p + #:x + #:y + #:width + #:height + #:rotation + #:scale-by + #:keydown + #:keyup + #:mousedown + #:mouseup + #:mousemotion + #:mousewheel + #:focus + #:blur + #:perframe + #:after-added + #:before-added + #:before-dropped + + )) |