Rename to "Consoom!", start putting art in

This commit is contained in:
Jeremy Penner 2023-11-05 22:56:00 -05:00
parent 729fb32d29
commit c9e749ab61
14 changed files with 28 additions and 19 deletions

View file

@ -2,7 +2,7 @@
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(shell for f in $(filter $(subst *,%,$2),$d); do [ -d "$$f" ] || printf "%s\n" "$$f"; done)) rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(shell for f in $(filter $(subst *,%,$2),$d); do [ -d "$$f" ] || printf "%s\n" "$$f"; done))
PDXNAME = Explosionface PDXNAME = Consoom!
EXCLUDESOURCES = src/macros.fnl EXCLUDESOURCES = src/macros.fnl
SOURCEFILES = $(filter-out $(EXCLUDESOURCES),$(call rwildcard, src, *.fnl)) SOURCEFILES = $(filter-out $(EXCLUDESOURCES),$(call rwildcard, src, *.fnl))
OUTFILES = $(subst src,source,$(SOURCEFILES:.fnl=.lua) $(filter-out $(SOURCEFILES),$(call rwildcard, src, *))) OUTFILES = $(subst src,source,$(SOURCEFILES:.fnl=.lua) $(filter-out $(SOURCEFILES),$(call rwildcard, src, *)))

Binary file not shown.

BIN
art/consume-card-raster.kra Normal file

Binary file not shown.

BIN
art/consume-card-raster.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
art/consume-card.kra Normal file

Binary file not shown.

View file

@ -29,7 +29,7 @@
value (. caches asset)] value (. caches asset)]
(if (not= value nil) value (if (not= value nil) value
(let [{: constructor : initializer} (. cache.asset-lifecycles asset) (let [{: constructor : initializer} (. cache.asset-lifecycles asset)
value (constructor)] value (constructor type id)]
(initializer value type id) (initializer value type id)
(tset caches asset value) (tset caches asset value)
value)))) value))))
@ -40,7 +40,7 @@
(when caches (when caches
(each [asset value (pairs caches)] (each [asset value (pairs caches)]
(let [{: destructor} (. cache.asset-lifecycles asset)] (let [{: destructor} (. cache.asset-lifecycles asset)]
(destructor value))) (when destructor (destructor value))))
(tset cache.caches type ?id nil))) (tset cache.caches type ?id nil)))
(let [?id-to-caches (. cache.caches type)] (let [?id-to-caches (. cache.caches type)]
(when ?id-to-caches (when ?id-to-caches

View file

@ -6,11 +6,11 @@
(local iter (require :meta.iter)) (local iter (require :meta.iter))
(local state (require :state)) (local state (require :state))
(local cache (require :cache)) (local cache (require :cache))
(local {: make-image : defsprite : sprite : dirty : with-bg-draw : with-image : with-collision} (require :sprite)) (local {: make-image : image : defsprite : sprite : dirty : with-bg-draw : with-image : with-collision} (require :sprite))
(local gfx playdate.graphics) (local gfx playdate.graphics)
(local devmode true) (local devmode false)
(local update (defmulti #$1)) (local update (defmulti #$1))
(local children (defmulti #$2)) (local children (defmulti #$2))
@ -49,11 +49,6 @@
(local screenw (playdate.display.getWidth)) (local screenw (playdate.display.getWidth))
(local screenh (playdate.display.getHeight)) (local screenh (playdate.display.getHeight))
(let [bucketw 50 bucketh 10 radius 4
xoffset (/ bucketw 2)
image (make-image bucketw bucketh #(gfx.drawRoundRect 0 0 bucketw bucketh radius))]
(defsprite :bucket #(doto $1 (with-image image 0.5 0.5) (with-collision 1 2))))
(fn lose-life [ctx] (fn lose-life [ctx]
(let [count ctx.bucket.count] (let [count ctx.bucket.count]
(dec ctx.bucket :count) (dec ctx.bucket :count)
@ -67,9 +62,12 @@
(let [crank (playdate.getCrankPosition) (let [crank (playdate.getCrankPosition)
ratio (if (> crank 180) (/ (- 360 crank) -130) (/ crank 130)) ratio (if (> crank 180) (/ (- 360 crank) -130) (/ crank 130))
x (* (/ (+ ratio 1) 2) screenw)] x (* (/ (+ ratio 1) 2) screenw)]
(for [ibucket 1 bucket.count] (if (> bucket.count 0)
(let [buckety (+ 190 (* (- ibucket 1) 20))] (doto (sprite :bucket)
(doto (sprite :bucket ibucket) (: :moveTo x buckety))))))) (with-image (image :gfx/mouth (math.min bucket.count 3)) 0.5 0)
(with-collision 1 2)
(: :moveTo x 190))
(doto (sprite :bucket) (with-image nil 0.5 0))))))
(let [image (make-image 20 30 #(gfx.fillRoundRect 0 0 20 30 6))] (let [image (make-image 20 30 #(gfx.fillRoundRect 0 0 20 30 6))]
(defsprite :bomber #(with-image $1 image 0.5 0))) (defsprite :bomber #(with-image $1 image 0.5 0)))
@ -113,6 +111,7 @@
(when (and (= ctx.state :bombing) (= bomber.bombs-left 0) (= (length ctx.bombs) 0)) (when (and (= ctx.state :bombing) (= bomber.bombs-left 0) (= (length ctx.bombs) 0))
(inc ctx :level) (inc ctx :level)
(set ctx.bucket.count 3)
(dirty :background) (dirty :background)
(set ctx.state :waiting)) (set ctx.state :waiting))

BIN
src/gfx/mouth-table-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

BIN
src/gfx/mouth-table-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

BIN
src/gfx/mouth-table-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
src/launcher/card.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -5,4 +5,4 @@
(import :package) (import :package)
(require :meta.reload) (require :meta.reload)
(require :explosion) (require :consoom)

View file

@ -1,5 +1,6 @@
name=Explosionface name=Consoom!
author=Jeremy Penner author=Jeremy Penner
description=Keep the world from exploding! description=Eat! Eat all the things! Eat forever!!
bundleID=com.glorioustrainwrecks.explosionface bundleID=com.glorioustrainwrecks.consoom
buildNumber=1 buildNumber=2
imagePath=launcher

View file

@ -2,6 +2,8 @@
(import :CoreLibs/sprites) (import :CoreLibs/sprites)
(cache.register-asset :sprite #(doto (playdate.graphics.sprite.new) (: :add) (: :setUpdatesEnabled false)) #($1:remove)) (cache.register-asset :sprite #(doto (playdate.graphics.sprite.new) (: :add) (: :setUpdatesEnabled false)) #($1:remove))
(cache.register-asset :image #(playdate.graphics.image.new $1))
(cache.register-asset :imagetable #(playdate.graphics.imagetable.new $1))
(local gfx playdate.graphics) (local gfx playdate.graphics)
@ -30,4 +32,11 @@
(doto spr (: :setGroupMask groupmask) (: :setCollidesWithGroupsMask collidemask) (doto spr (: :setGroupMask groupmask) (: :setCollidesWithGroupsMask collidemask)
(: :setCollideRect (if ?colliderect ?colliderect (values 0 0 (spr:getSize)))))) (: :setCollideRect (if ?colliderect ?colliderect (values 0 0 (spr:getSize))))))
{: make-image : defsprite : sprite : dirty : with-image : with-collision : with-draw : with-bg-draw} (fn image [filename ?i ?y]
(if (not= ?y nil)
(: (cache.get :imagetable filename) :getImage ?i ?y)
(not= ?i nil)
(: (cache.get :imagetable filename) :getImage ?i)
(cache.get :image filename)))
{: make-image : image : defsprite : sprite : dirty : with-image : image : with-collision : with-draw : with-bg-draw}