diff options
-rw-r--r-- | assets.lisp | 74 | ||||
-rw-r--r-- | assets/Nance-Proto.png | bin | 4889 -> 0 bytes | |||
-rw-r--r-- | assets/emoji.png | bin | 37938 -> 44395 bytes | |||
-rw-r--r-- | the-price-of-a-cup-of-coffee.lisp | 13 |
4 files changed, 48 insertions, 39 deletions
diff --git a/assets.lisp b/assets.lisp index 0df33a6..3a30a35 100644 --- a/assets.lisp +++ b/assets.lisp @@ -46,40 +46,46 @@ (:NAME "WalkRight2" :X 0 :Y 0 :WIDTH 64 :HEIGHT 128))) (defparameter +emoji-defs+ -'((:NAME "angry" :X 216 :Y 144 - :WIDTH 72 :HEIGHT 72) - (:NAME "asshole" :X 216 :Y 216 - :WIDTH 72 :HEIGHT 72) - (:NAME "breakdown" :X 288 :Y 0 - :WIDTH 72 :HEIGHT 72) - (:NAME "chance" :X 72 :Y 216 - :WIDTH 72 :HEIGHT 72) - (:NAME "death" :X 144 :Y 216 - :WIDTH 72 :HEIGHT 72) - (:NAME "dollars" :X 0 :Y 288 - :WIDTH 72 :HEIGHT 72) - (:NAME "food1" :X 144 :Y 72 - :WIDTH 72 :HEIGHT 72) - (:NAME "food2" :X 144 :Y 144 - :WIDTH 72 :HEIGHT 72) - (:NAME "food3" :X 216 :Y 0 - :WIDTH 72 :HEIGHT 72) - (:NAME "food4" :X 72 :Y 144 - :WIDTH 72 :HEIGHT 72) - (:NAME "food5" :X 0 :Y 216 - :WIDTH 72 :HEIGHT 72) - (:NAME "incapacitated" :X 72 :Y 72 - :WIDTH 72 :HEIGHT 72) - (:NAME "nauseated" :X 144 :Y 0 - :WIDTH 72 :HEIGHT 72) - (:NAME "relaxed" :X 0 :Y 144 - :WIDTH 72 :HEIGHT 72) - (:NAME "sick" :X 72 :Y 0 - :WIDTH 72 :HEIGHT 72) - (:NAME "stressed" :X 0 :Y 72 - :WIDTH 72 :HEIGHT 72) - (:NAME "very-angry" :X 0 :Y 0 - :WIDTH 72 :HEIGHT 72))) + '((:NAME "alarmed-question" :X 216 :Y 288 + :WIDTH 72 :HEIGHT 72) + (:NAME "alarmed" :X 0 :Y 360 + :WIDTH 72 :HEIGHT 72) + (:NAME "angry" :X 216 :Y 72 + :WIDTH 72 :HEIGHT 72) + (:NAME "asshole" :X 216 :Y 144 + :WIDTH 72 :HEIGHT 72) + (:NAME "breakdown" :X 216 :Y 216 + :WIDTH 72 :HEIGHT 72) + (:NAME "chance" :X 288 :Y 0 + :WIDTH 72 :HEIGHT 72) + (:NAME "cold" :X 72 :Y 216 + :WIDTH 72 :HEIGHT 72) + (:NAME "death" :X 144 :Y 216 + :WIDTH 72 :HEIGHT 72) + (:NAME "dollars" :X 0 :Y 288 + :WIDTH 72 :HEIGHT 72) + (:NAME "food1" :X 144 :Y 72 + :WIDTH 72 :HEIGHT 72) + (:NAME "food2" :X 144 :Y 144 + :WIDTH 72 :HEIGHT 72) + (:NAME "food3" :X 216 :Y 0 + :WIDTH 72 :HEIGHT 72) + (:NAME "food4" :X 72 :Y 144 + :WIDTH 72 :HEIGHT 72) + (:NAME "food5" :X 0 :Y 216 + :WIDTH 72 :HEIGHT 72) + (:NAME "incapacitated" :X 72 :Y 72 + :WIDTH 72 :HEIGHT 72) + (:NAME "nauseated" :X 144 :Y 0 + :WIDTH 72 :HEIGHT 72) + (:NAME "relaxed" :X 0 :Y 144 + :WIDTH 72 :HEIGHT 72) + (:NAME "sick" :X 72 :Y 0 + :WIDTH 72 :HEIGHT 72) + (:NAME "stressed" :X 0 :Y 72 + :WIDTH 72 :HEIGHT 72) + (:NAME "very-angry" :X 0 :Y 0 + :WIDTH 72 :HEIGHT 72))) (defparameter +shared-faces+ (create-sprite-faces +tile-defs+)) diff --git a/assets/Nance-Proto.png b/assets/Nance-Proto.png Binary files differdeleted file mode 100644 index 7507647..0000000 --- a/assets/Nance-Proto.png +++ /dev/null diff --git a/assets/emoji.png b/assets/emoji.png Binary files differindex 949e01b..aeeea9a 100644 --- a/assets/emoji.png +++ b/assets/emoji.png diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp index 3769f1a..63aa314 100644 --- a/the-price-of-a-cup-of-coffee.lisp +++ b/the-price-of-a-cup-of-coffee.lisp @@ -16,7 +16,7 @@ (defvar *tweens* nil) (defvar *expression-rect* - (sdl2:make-rect 0 0 64 64) + (sdl2:make-rect 0 0 50 50) "used to render expressions.") @@ -172,7 +172,7 @@ (sdl2:rect-x (pos human))) (setf (sdl2:rect-y *expression-rect*) (- (sdl2:rect-y (pos human)) - 48))) + (sdl2:rect-height *expression-rect*)))) (defmethod render ((human human) renderer) (with-slots (pos sheet faces face frame expression) human @@ -243,7 +243,7 @@ (let ((suit (make-instance 'pedestrian :sheet *suit-texture* - :comfort-rad 60 + :comfort-rad 100 :anger 0.1 :kindness 0.015 :generosity 0.5 @@ -260,6 +260,10 @@ (defun boot-up (renderer) + ;; cleanup from previous calls to start - used while testing + (setf *pedestrians* nil) + (setf *to-render-by-y* nil) + (boot-up-assets renderer) ;; boot up nance @@ -270,7 +274,6 @@ (push *nance* *to-render-by-y*) ;; boot up initial pedestrians - (setf *pedestrians* nil) (push (make-suit) *pedestrians*) (push (car *pedestrians*) *to-render-by-y*)) @@ -452,7 +455,7 @@ ;;move-away (match walk-vec ((cons old-dx 0) - (when (cointoss) (emote person1 "alarmed" 1000)) + (when (cointoss 0.2) (emote person1 "alarmed" 1000)) (setf (car walk-vec) (* (signum old-dx) diag-walk-speed)) (setf (cdr walk-vec) (* (signum (- (y-pos person1) (y-pos person2))) diag-walk-speed)))) |