summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-10-18 12:08:23 -0500
committerBoutade <thegoofist@protonmail.com>2019-10-18 12:08:23 -0500
commit555d4366e1d9b8ffd05d704231a6e00d17837b6e (patch)
tree45a971609bbb228b07c2285fa3cd6e85e28d8b31
parentabd60654f2ad13f32f616dba88c85c3ba7690b2d (diff)
stressed out sequence
-rw-r--r--the-price-of-a-cup-of-coffee.lisp28
1 files changed, 27 insertions, 1 deletions
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp
index 9444427..2e954d3 100644
--- a/the-price-of-a-cup-of-coffee.lisp
+++ b/the-price-of-a-cup-of-coffee.lisp
@@ -255,7 +255,31 @@
(sickness-check)
(pause-then 1000 #'check-sickness-loop))
-
+(defvar *collision-on-p* t)
+(defvar *input-mode* :normal) ;; (or :normal :start nil)
+
+(defun stressed-out-sequence ()
+ (setf *collision-on-p* nil)
+ (setf *input-mode* nil)
+ (emote *nance* "incapacitated")
+ (with-slots (pos face) *nance*
+ (let ((move-to-home-base
+ (sequencing (:at (sdl2:get-ticks) :targeting pos)
+ (grouping (:for 2000)
+ (animating :the 'sdl2:rect-x :to +home-base-x+)
+ (animating :the 'sdl2:rect-y :to +home-base-y+))
+ (take-action (lambda ()
+ (print "calling first callback")
+ (setf face 'facing-down)
+ (emote *nance* "breakdown")))
+ (animate *stress-meter* 'percent 0.25
+ :rounding nil :duration 4000 :ease #'quad-in-out
+ :on-complete (lambda ()
+ (print "calling second callback")
+ (emote *nance* nil)
+ (setf *collision-on-p* t)
+ (setf *input-mode* :normal))))))
+ (push move-to-home-base *tweens*))))
(defun in-front-of-door-p ()
(with-slots (pos) *nance*
@@ -320,6 +344,8 @@
(setf (sdl2:rect-y (pos suit)) (random-y-pos))
suit))
+(defparameter +home-base-y+ 38)
+(defparameter +home-base-x+ 292)
(defun boot-up (renderer)
;; cleanup from previous calls to start - used while testing