summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/Nance-Proto.pngbin0 -> 4889 bytes
-rw-r--r--package.lisp7
-rw-r--r--the-price-of-a-cup-of-coffee.asd11
-rw-r--r--the-price-of-a-cup-of-coffee.lisp59
4 files changed, 77 insertions, 0 deletions
diff --git a/assets/Nance-Proto.png b/assets/Nance-Proto.png
new file mode 100644
index 0000000..7507647
--- /dev/null
+++ b/assets/Nance-Proto.png
Binary files differ
diff --git a/package.lisp b/package.lisp
new file mode 100644
index 0000000..dd998cb
--- /dev/null
+++ b/package.lisp
@@ -0,0 +1,7 @@
+;;;; package.lisp
+
+(defpackage #:the-price-of-a-cup-of-coffee
+ (:use #:cl #:alexandria #:animise)
+ (:nicknames #:pocc))
+
+
diff --git a/the-price-of-a-cup-of-coffee.asd b/the-price-of-a-cup-of-coffee.asd
new file mode 100644
index 0000000..00bb264
--- /dev/null
+++ b/the-price-of-a-cup-of-coffee.asd
@@ -0,0 +1,11 @@
+;;;; the-price-of-a-cup-of-coffee.asd
+
+(asdf:defsystem #:the-price-of-a-cup-of-coffee
+ :description "Just a cold day on a busy street."
+ :author "<thegoofist@protonmail.com>"
+ :license "GPL3"
+ :version "0.0.1"
+ :serial t
+ :depends-on (#:animise #:sdl2 #:sdl2-image #:harmony)
+ :components ((:file "package")
+ (:file "the-price-of-a-cup-of-coffee")))
diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp
new file mode 100644
index 0000000..50f8cf3
--- /dev/null
+++ b/the-price-of-a-cup-of-coffee.lisp
@@ -0,0 +1,59 @@
+;;;; the-price-of-a-cup-of-coffee.lisp
+
+(in-package #:the-price-of-a-cup-of-coffee)
+
+(defun make-keyword-symbol (s)
+ "Makes a keyword from a string or symbol."
+ (let ((s (format nil "~a" s)))
+ (read-from-string
+ (format nil ":~a"
+ (substitute #\- #\Space s)))))
+
+
+(defmacro def-normal-class (name super &rest slots)
+ "Defines a class with the given name and slots, with accessors and initargs for each slot."
+ `(defclass ,name ,super
+ (,@(loop :for slot :in slots
+ :when (consp slot)
+ :collect (list (car slot)
+ :accessor (car slot)
+ :initform (cadr slot)
+ :initarg (make-keyword-symbol (car slot)))
+ :else
+ :collect (list slot
+ :accessor slot
+ :initform nil
+ :initarg (make-keyword-symbol slot))))))
+
+(def-normal-class pedestrian ()
+ (walk-vec (list 2 0))
+ (comfort-rad 60)
+ (react-per-sec 1)
+ (anger 0.1)
+ (kindness 0.02)
+ (generosity 0.25)
+ (vulnerability 3))
+
+
+(def-normal-class ()
+ (stress 0)
+ (money 0)
+ (coldness 0)
+ (sick-p nil)
+ (speed 5)
+ (relax-rate 1)
+
+
+(defun main ()
+ (sdl2:with-init (:everything)
+ (sdl2:with-window (win :w 800 :h 600 :title "The Price Of A Cup Of Coffee" :flags '(:shown))
+ (sdl2:with-renderer (rndr win :flags '(:accelerated))
+ (sdl2:with-event-loop (:method :poll)
+ (:keydown (:keysym keysym)
+ (if (sdl2:scancode= (sdl2:scancode-value keysym) :scancode-escape)
+ (sdl2:push-event :quit)))
+ (:idle ())
+
+ (:quit () t))))))
+
+