From 867703d82c6e8b7a2b424845fcb30537061de45a Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 1 Jul 2022 09:47:16 -0500 Subject: [add] frameset class and an [exmaple] using it --- examples/05-frameset-animation.lisp | 41 ++++++++++++++++++++++++++++++++++++ examples/dude/Back_Left.png | Bin 0 -> 1106 bytes examples/dude/Back_Right.png | Bin 0 -> 1112 bytes examples/dude/Back_Stand.png | Bin 0 -> 1041 bytes examples/dude/Front_Left.png | Bin 0 -> 1348 bytes examples/dude/Front_Right.png | Bin 0 -> 1356 bytes examples/dude/Front_Stand.png | Bin 0 -> 1356 bytes examples/dude/Left_Left.png | Bin 0 -> 1174 bytes examples/dude/Left_Right.png | Bin 0 -> 1227 bytes examples/dude/Left_Stand.png | Bin 0 -> 1038 bytes examples/dude/Right_Left.png | Bin 0 -> 1206 bytes examples/dude/Right_Right.png | Bin 0 -> 1189 bytes examples/dude/Right_Stand.png | Bin 0 -> 1043 bytes 13 files changed, 41 insertions(+) create mode 100644 examples/05-frameset-animation.lisp create mode 100644 examples/dude/Back_Left.png create mode 100644 examples/dude/Back_Right.png create mode 100644 examples/dude/Back_Stand.png create mode 100644 examples/dude/Front_Left.png create mode 100644 examples/dude/Front_Right.png create mode 100644 examples/dude/Front_Stand.png create mode 100644 examples/dude/Left_Left.png create mode 100644 examples/dude/Left_Right.png create mode 100644 examples/dude/Left_Stand.png create mode 100644 examples/dude/Right_Left.png create mode 100644 examples/dude/Right_Right.png create mode 100644 examples/dude/Right_Stand.png (limited to 'examples') diff --git a/examples/05-frameset-animation.lisp b/examples/05-frameset-animation.lisp new file mode 100644 index 0000000..4686ecc --- /dev/null +++ b/examples/05-frameset-animation.lisp @@ -0,0 +1,41 @@ +;;;; examples/05-frameset-animation.lisp + +(defpackage #:ww.examples/5 + (:use #:cl)) + +(in-package #:ww.examples/5) + +(defclass frameset-example (ww::application) ()) + +(ww::defhandler toggle-on-click + (ww::on-mousedown () + (setf (ww::runningp target) + (not (ww::runningp target))))) + +(defmethod ww::boot ((app frameset-example)) + (let ((fs + (ww::make-frameset + '("dude/Front_Stand.png" + "dude/Front_Left.png" + "dude/Front_Stand.png" + "dude/Front_Right.png") + :fps 3))) + + (setf (ww::x fs) 380 + (ww::y fs) 200) + + (ww::add-handler fs #'toggle-on-click) + + (ww::add-unit app fs))) + + +(defun start () + (ww::start (make-instance + 'frameset-example + :fps 30 + :width 800 + :height 600 + :title "Wheelwork Example: An Animated Sprite" + :asset-root (merge-pathnames + "examples/" + (asdf:system-source-directory :wheelwork))))) diff --git a/examples/dude/Back_Left.png b/examples/dude/Back_Left.png new file mode 100644 index 0000000..e6f478a Binary files /dev/null and b/examples/dude/Back_Left.png differ diff --git a/examples/dude/Back_Right.png b/examples/dude/Back_Right.png new file mode 100644 index 0000000..f6ea62b Binary files /dev/null and b/examples/dude/Back_Right.png differ diff --git a/examples/dude/Back_Stand.png b/examples/dude/Back_Stand.png new file mode 100644 index 0000000..e19a445 Binary files /dev/null and b/examples/dude/Back_Stand.png differ diff --git a/examples/dude/Front_Left.png b/examples/dude/Front_Left.png new file mode 100644 index 0000000..b2c2982 Binary files /dev/null and b/examples/dude/Front_Left.png differ diff --git a/examples/dude/Front_Right.png b/examples/dude/Front_Right.png new file mode 100644 index 0000000..4ca4936 Binary files /dev/null and b/examples/dude/Front_Right.png differ diff --git a/examples/dude/Front_Stand.png b/examples/dude/Front_Stand.png new file mode 100644 index 0000000..43c2171 Binary files /dev/null and b/examples/dude/Front_Stand.png differ diff --git a/examples/dude/Left_Left.png b/examples/dude/Left_Left.png new file mode 100644 index 0000000..1739101 Binary files /dev/null and b/examples/dude/Left_Left.png differ diff --git a/examples/dude/Left_Right.png b/examples/dude/Left_Right.png new file mode 100644 index 0000000..d9c82e1 Binary files /dev/null and b/examples/dude/Left_Right.png differ diff --git a/examples/dude/Left_Stand.png b/examples/dude/Left_Stand.png new file mode 100644 index 0000000..ae0379d Binary files /dev/null and b/examples/dude/Left_Stand.png differ diff --git a/examples/dude/Right_Left.png b/examples/dude/Right_Left.png new file mode 100644 index 0000000..90137a8 Binary files /dev/null and b/examples/dude/Right_Left.png differ diff --git a/examples/dude/Right_Right.png b/examples/dude/Right_Right.png new file mode 100644 index 0000000..0e5aa39 Binary files /dev/null and b/examples/dude/Right_Right.png differ diff --git a/examples/dude/Right_Stand.png b/examples/dude/Right_Stand.png new file mode 100644 index 0000000..6763b43 Binary files /dev/null and b/examples/dude/Right_Stand.png differ -- cgit v1.2.3