diff options
Diffstat (limited to 'examples/10-canvas-sneks.lisp')
-rw-r--r-- | examples/10-canvas-sneks.lisp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/examples/10-canvas-sneks.lisp b/examples/10-canvas-sneks.lisp index ef5d1d5..52c71fd 100644 --- a/examples/10-canvas-sneks.lisp +++ b/examples/10-canvas-sneks.lisp @@ -2,25 +2,24 @@ (defpackage #:ww.examples/10 (:use #:cl) - (:export #:start) - (:import-from #:defclass-std #:defclass/std)) + (:export #:start)) (in-package #:ww.examples/10) ;;; CLASSES -(defclass/std sneking (ww:application) - ((sneks snek-pit) - (population :std 10))) - -(defclass/std snek () - ((x y) - (dx dy :std 1) - (brain :std 0.0) - (bod :std (list)) - (len :std 4) - (color :std (list 255 255 255)) - (home :std (list 0 0 100 100)))) +(def:class sneking (ww:application) + (sneks snek-pit :initform nil) + (population :initform 10)) + +(def:class snek () + (x y dx dy :initform 1) + (brain :initform 0.0) + (bod :initform (list)) + (len :initform 4) + (color :initform (list 255 255 255)) + (home :initform (list 0 0 100 100)) + :documentation "A SNEK is a contiguous chain of virtual pixels (i.e. square blocks of color), all the same coloor") (defun snek-is-home-p (snek) (with-slots (x y home) snek |