;;; 01-bitmap-display.lisp (defpackage #:ww.examples/2 (:use #:cl) (:export #:start)) (in-package :ww.examples/2) (defclass bitmap-display (ww::application ) ()) (ww::defhandler move-thing (ww::on-keydown (target code mods) (case code (:scancode-left (decf (ww::unit-x target) (ww::unit-width target))) (:scancode-right (incf (ww::unit-x target) (ww::unit-width target))) (:scancode-down (decf (ww::unit-y target) (ww::unit-height target))) (:scancode-up (incf (ww::unit-y target) (ww::unit-height target))) (:scancode-equals (print mods))))) (defmethod ww::boot ((app bitmap-display)) (let ((bm (make-instance 'ww::bitmap :texture (ww::get-asset "Fezghoul.png")))) (ww::refocus-on bm) (ww::set-handler bm *move-thing*) (ww::add-unit app bm))) (defun start () (ww::start (make-instance 'bitmap-display :scale 3.0 :asset-root #P"~/projects/wheelwork/examples/")))