summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets.lisp30
-rw-r--r--assets/Normy.pngbin0 -> 130358 bytes
-rw-r--r--the-price-of-a-cup-of-coffee.lisp23
3 files changed, 33 insertions, 20 deletions
diff --git a/assets.lisp b/assets.lisp
index 0d4848b..f08919f 100644
--- a/assets.lisp
+++ b/assets.lisp
@@ -50,9 +50,39 @@
(defparameter +nance-sheet-image+ "assets/Nance.png")
(defparameter +suit-sheet-image+ "assets/Suit.png")
+(defparameter +nomry-sheet-image+ "assets/Normy.png")
+(defparameter +things-look-up-track-path+ #P"assets/thingslookup.mp3")
+(defparameter +cold-day-track-path+ #P"assets/coldday.mp3")
+
(defvar *nance-texture*)
(defvar *suit-texture*)
+(defvar *normy-texture*)
+
+(defvar *harmony-initialized-p* nil)
+(defvar *cold-day-track*)
+(defvar *looking-up-track*)
+(defvar *current-track*)
+
+
+
+(defun boot-up-assets (renderer)
+ (with-surface-from-file (surf +nance-sheet-image+)
+ (setf *nance-texture* (sdl2:create-texture-from-surface renderer surf)))
+
+ (with-surface-from-file (surf +suit-sheet-image+)
+ (setf *suit-texture* (sdl2:create-texture-from-surface renderer surf)))
+
+ (unless *harmony-initialized-p*
+ (harmony-simple:initialize)
+ (setf *looking-up-track* (harmony-simple:play +things-look-up-track-path+ :music :loop t))
+ (harmony-simple:stop *looking-up-track*)
+ (setf *cold-day-track* (harmony-simple:play +cold-day-track-path+ :music :loop t))
+ (setf *current-track* *cold-day-track*)
+ (harmony-simple:stop *cold-day-track*)
+ (setf *harmony-initialized-p* t)))
+
+
diff --git a/assets/Normy.png b/assets/Normy.png
new file mode 100644
index 0000000..6a4c2aa
--- /dev/null
+++ b/assets/Normy.png
Binary files differ
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp
index 2de4a4d..f04908e 100644
--- a/the-price-of-a-cup-of-coffee.lisp
+++ b/the-price-of-a-cup-of-coffee.lisp
@@ -176,12 +176,11 @@
(defun boot-up (renderer)
- (with-surface-from-file (surf +nance-sheet-image+)
- (setf *nance-texture* (sdl2:create-texture-from-surface renderer surf)))
- (with-surface-from-file (surf +suit-sheet-image+)
- (setf *suit-texture* (sdl2:create-texture-from-surface renderer surf)))
+ (boot-up-assets renderer)
+
+
(setf *nance* (make-instance 'hero :sheet *nance-texture*)))
@@ -378,11 +377,6 @@
;; present
(sdl2:render-present renderer))
-(defvar *harmony-initialized-p* nil)
-(defvar *cold-day-track*)
-(defvar *looking-up-track*)
-(defvar *current-track*)
-
(defun play-track (track)
(harmony-simple:stop *current-track*)
(harmony-simple:resume track)
@@ -396,14 +390,6 @@
(defun start ()
- ;; (unless *harmony-initialized-p*
- ;; (harmony-simple:initialize)
- ;; (setf *looking-up-track* (harmony-simple:play #p"assets/thingslookup.mp3" :music :loop t))
- ;; (harmony-simple:stop *looking-up-track*)
- ;; (setf *cold-day-track* (harmony-simple:play #p"assets/coldday.mp3" :music :loop t))
- ;; (setf *current-track* *cold-day-track*)
- ;; (setf *harmony-initialized-p* t))
-
;; (play-track *cold-day-track*)
(sdl2:with-init (:everything)
@@ -429,9 +415,6 @@
(:quit ()
; (harmony-simple:stop *current-track*)
- (free-assets)
t))))))
-(defun free-assets ()
- (setf (sheet *nance*) nil))