summaryrefslogtreecommitdiff
path: root/the-price-of-a-cup-of-coffee.lisp
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-10-16 17:26:56 -0500
committerBoutade <thegoofist@protonmail.com>2019-10-16 17:26:56 -0500
commit5dcab2d008d9241d65ce42318cf89810397881b9 (patch)
tree9f52a61f3c8018d8d452b17ace799e0fc7cb0254 /the-price-of-a-cup-of-coffee.lisp
parent31619ba2715d0b78b7b536f6412acd402d7096c8 (diff)
tweaks
Diffstat (limited to 'the-price-of-a-cup-of-coffee.lisp')
-rw-r--r--the-price-of-a-cup-of-coffee.lisp8
1 files changed, 6 insertions, 2 deletions
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp
index e1a37ed..3769f1a 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 32 32)
+ (sdl2:make-rect 0 0 64 64)
"used to render expressions.")
@@ -172,7 +172,7 @@
(sdl2:rect-x (pos human)))
(setf (sdl2:rect-y *expression-rect*)
(- (sdl2:rect-y (pos human))
- 36)))
+ 48)))
(defmethod render ((human human) renderer)
(with-slots (pos sheet faces face frame expression) human
@@ -442,6 +442,9 @@
(dy (- (y-pos person1) (y-pos person2))))
(sqrt (+ (* dx dx) (* dy dy)))))
+(defun cointoss (&optional (loaded 0.5))
+ (< (random 1.0) loaded))
+
(defun adjust-walk-relative-to (person1 person2)
(when (walking-p person1)
(with-slots (comfort-rad walk-vec walk-speed diag-walk-speed) person1
@@ -449,6 +452,7 @@
;;move-away
(match walk-vec
((cons old-dx 0)
+ (when (cointoss) (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))))