Compare commits
No commits in common. "e992bd986fdbf28c69c69198ec1c0de8e2f14e56" and "34a30412edc6f127345e2c3477abbe790738e788" have entirely different histories.
e992bd986f
...
34a30412ed
10 changed files with 28 additions and 59 deletions
|
@ -1,5 +1,5 @@
|
||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.3.4
|
current_version = 0.3.3
|
||||||
tag = True
|
tag = True
|
||||||
commit = True
|
commit = True
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
(define-public bloatrunner
|
(define-public bloatrunner
|
||||||
(package
|
(package
|
||||||
(name "bloatrunner")
|
(name "bloatrunner")
|
||||||
(version "0.3.4-git")
|
(version "0.3.3-git")
|
||||||
;; (source (git-checkout (url (dirname (current-filename)))))
|
;; (source (git-checkout (url (dirname (current-filename)))))
|
||||||
(source (local-file "../.." "guile-checkout"
|
(source (local-file "../.." "guile-checkout"
|
||||||
#:recursive? #t
|
#:recursive? #t
|
||||||
|
|
15
README.org
15
README.org
|
@ -36,7 +36,7 @@ let the _others_ fall in so you can pass over their head.
|
||||||
So now, go out, collect the keys and maintain a healthy diet!
|
So now, go out, collect the keys and maintain a healthy diet!
|
||||||
|
|
||||||
|
|
||||||
* Game Plan [20/25]
|
* Game Plan [20/22]
|
||||||
|
|
||||||
- [X] start project organization
|
- [X] start project organization
|
||||||
- [X] select some assets to start with
|
- [X] select some assets to start with
|
||||||
|
@ -60,9 +60,6 @@ So now, go out, collect the keys and maintain a healthy diet!
|
||||||
- [X] add foods and bloat indicator
|
- [X] add foods and bloat indicator
|
||||||
- [X] scale hero waist related to bloat level
|
- [X] scale hero waist related to bloat level
|
||||||
- [X] create more levels
|
- [X] create more levels
|
||||||
- [ ] slow down if hungry or had too much to eat
|
|
||||||
- [ ] add more text to explain things
|
|
||||||
- [ ] add text bubbles with unhelpful comments
|
|
||||||
- [ ] dig potholes
|
- [ ] dig potholes
|
||||||
- [ ] make others steal keys
|
- [ ] make others steal keys
|
||||||
- [X] some level celebration/animation
|
- [X] some level celebration/animation
|
||||||
|
@ -82,7 +79,7 @@ Untar the filename, enter the newly created folder and launch `bloatrunner/bloat
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
*** DONE make an upload script which cleans up the filename
|
*** TODO make an upload script which cleans up the filename
|
||||||
|
|
||||||
The current filename contains the GUIX UUID which is ugly and not very
|
The current filename contains the GUIX UUID which is ugly and not very
|
||||||
userfriendly.
|
userfriendly.
|
||||||
|
@ -166,7 +163,7 @@ $ watchexec -e .scm ./pre-inst-env bloatrunner
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
** DONE Bundling
|
** TODO Bundling
|
||||||
|
|
||||||
Use `guix pack`.
|
Use `guix pack`.
|
||||||
|
|
||||||
|
@ -260,12 +257,6 @@ the environment variables set according to the installed environment.
|
||||||
|
|
||||||
most of this is dynamically construct the content of the paths.
|
most of this is dynamically construct the content of the paths.
|
||||||
|
|
||||||
** Publishing to Itch.io
|
|
||||||
|
|
||||||
The autoconf also creates a `publish` script to create a distribution
|
|
||||||
and upload to itch.io.
|
|
||||||
|
|
||||||
|
|
||||||
* Asset Dependencies
|
* Asset Dependencies
|
||||||
|
|
||||||
** Hero sprites
|
** Hero sprites
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
WWWWWGWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
|
WWWWWGWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
|
||||||
W H W
|
W H W
|
||||||
W O H O W
|
W O H O W
|
||||||
W H K K F K F H W
|
W H K F K f K F F H W
|
||||||
W O BBBBBBBBBBBBBBBBBBBBBBBBBBHB O W -
|
W O BBBBBBBBBBBBBBBBBBBBBBBBBBHB O W -
|
||||||
W H W
|
W H W
|
||||||
W H W
|
W H W
|
||||||
|
|
|
@ -5,15 +5,15 @@
|
||||||
WWWWWWWWWWWWWWWWWWWGWWWWWWWWWWWWWWWWWWWW
|
WWWWWWWWWWWWWWWWWWWGWWWWWWWWWWWWWWWWWWWW
|
||||||
W H W
|
W H W
|
||||||
W O H O W
|
W O H O W
|
||||||
W H F K F H K F H W
|
W H K H K H W
|
||||||
W O BHBBBBBBBBBBBBBBBBBBBBBBBBH O W -
|
W O BHBBBBBBBBBBBBBBBBBBBBBBBBH O W -
|
||||||
W HH H W
|
W HH H W
|
||||||
W HHH H W
|
W HHH H W
|
||||||
W HHHH H H W
|
W HHHH H H W
|
||||||
W BBBHHHH BBBBBBBHB W
|
W BBBBHHHH BBBBBBBHB W
|
||||||
W HHHH HHHH W -
|
W HHHH HHHH W -
|
||||||
W HHHH HHHH W
|
W HHHH HHHH W
|
||||||
W H K HHHHHHHHHHHH F f HHHH W
|
W H K HHHHHHHHHHHH HHHH W
|
||||||
W BHBBBB HHHHHHHHHHHHHHHHHHHH W
|
W BHBBBB HHHHHHHHHHHHHHHHHHHH W
|
||||||
W H HH W
|
W H HH W
|
||||||
W H HH W -
|
W H HH W -
|
||||||
|
@ -21,7 +21,7 @@ W H HH W
|
||||||
W H HH W
|
W H HH W
|
||||||
W H H W
|
W H H W
|
||||||
W H H W
|
W H H W
|
||||||
W H H H KFFH W -
|
W H H H K H W -
|
||||||
W BBBBBBBBBHB P BHBBBBBBB W
|
W BBBBBBBBBHB P BHBBBBBBB W
|
||||||
W H H W
|
W H H W
|
||||||
W H H W
|
W H H W
|
||||||
|
@ -29,6 +29,6 @@ W H H W
|
||||||
W BHBBBBBBBBBBBHB W -
|
W BHBBBBBBBBBBBHB W -
|
||||||
W H H W
|
W H H W
|
||||||
W H H W
|
W H H W
|
||||||
W H F K f H W
|
W H K H W
|
||||||
WBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBW
|
WBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBW
|
||||||
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -
|
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW -
|
|
@ -1,6 +1,6 @@
|
||||||
dnl -*- Autoconf -*-
|
dnl -*- Autoconf -*-
|
||||||
|
|
||||||
AC_INIT(bloatrunner, 0.3.4)
|
AC_INIT(bloatrunner, 0.3.3)
|
||||||
AC_CONFIG_SRCDIR(game)
|
AC_CONFIG_SRCDIR(game)
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AM_INIT_AUTOMAKE([foreign -Woverride -Wno-portability])
|
AM_INIT_AUTOMAKE([foreign -Woverride -Wno-portability])
|
||||||
|
|
|
@ -55,16 +55,16 @@
|
||||||
"return the current position of the hero"
|
"return the current position of the hero"
|
||||||
(runner-position (hero-runner hero)))
|
(runner-position (hero-runner hero)))
|
||||||
|
|
||||||
(define (clamp lower upper x)
|
|
||||||
"return x clamped to the given lower and upper bounds"
|
|
||||||
(min upper (max lower x)))
|
|
||||||
|
|
||||||
(define (hero-bloat hero)
|
(define (hero-bloat hero)
|
||||||
"return the current bloat of the hero clamped to 0.5 and 2.0"
|
"return the current bloat of the hero clamped to 0.5 and 2.0"
|
||||||
(let* ((calories (- (hero-eaten hero) (hero-exercise hero)))
|
(let* ((calories (- (hero-eaten hero) (hero-exercise hero)))
|
||||||
(raw-bloat (+ 1.0 (/ calories 2000.0)))
|
(raw-bloat (+ 1.0 (/ calories 2000.0)))
|
||||||
)
|
)
|
||||||
(clamp 0.5 2.0 raw-bloat)))
|
(cond
|
||||||
|
((< calories -1000) 0.5)
|
||||||
|
((> calories 1000) 2.0)
|
||||||
|
(else raw-bloat)
|
||||||
|
)))
|
||||||
|
|
||||||
(define (collides? a b)
|
(define (collides? a b)
|
||||||
"return true if the position collides with the given position"
|
"return true if the position collides with the given position"
|
||||||
|
@ -83,12 +83,12 @@
|
||||||
(define moving-exercise 0.2)
|
(define moving-exercise 0.2)
|
||||||
|
|
||||||
(define (calculate-exercise hero new-position)
|
(define (calculate-exercise hero new-position)
|
||||||
"return the calories burned for the hero moving to the new position"
|
|
||||||
(let ((movement (vec2- new-position (hero-position hero))))
|
(let ((movement (vec2- new-position (hero-position hero))))
|
||||||
(+
|
(+
|
||||||
(if (> (vec2-y movement) 0) climbing-exercise 0)
|
(if (> (vec2-y movement) 0) climbing-exercise 0)
|
||||||
(if (not (zero? (vec2-x movement))) moving-exercise 0))))
|
(if (not (zero? (vec2-x movement))) moving-exercise 0))))
|
||||||
|
|
||||||
|
|
||||||
(define (hero-update hero level inputs keys calories-eaten dt)
|
(define (hero-update hero level inputs keys calories-eaten dt)
|
||||||
(let* ((new-runner (runner-update (hero-runner hero) level inputs dt))
|
(let* ((new-runner (runner-update (hero-runner hero) level inputs dt))
|
||||||
(new-runner (if (blocked-by-door?
|
(new-runner (if (blocked-by-door?
|
||||||
|
@ -131,10 +131,6 @@
|
||||||
(test-assert (not (blocked-by-door? level '(dummy-key) (vec2- goal-position (vec2 0 -16)) 1.0)))
|
(test-assert (not (blocked-by-door? level '(dummy-key) (vec2- goal-position (vec2 0 -16)) 1.0)))
|
||||||
(test-assert (blocked-by-door? level '() goal-position 1.55))
|
(test-assert (blocked-by-door? level '() goal-position 1.55))
|
||||||
|
|
||||||
(test-equal 0.5 (clamp 0.5 2.0 0.0 ))
|
|
||||||
(test-equal 1.5 (clamp 0.5 2.0 1.5))
|
|
||||||
(test-equal 2.0 (clamp 0.5 2.0 2.5))
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(test-end "hero-model")
|
(test-end "hero-model")
|
||||||
|
|
|
@ -72,20 +72,20 @@
|
||||||
#:texture-region texture-region)))
|
#:texture-region texture-region)))
|
||||||
(iota (level-width level) 0)))
|
(iota (level-width level) 0)))
|
||||||
(iota (level-height level) 0)))
|
(iota (level-height level) 0)))
|
||||||
|
|
||||||
|
|
||||||
;; render the level tiles
|
;; render the level tiles
|
||||||
(define (render-level-draw level)
|
(define (render-level-draw level)
|
||||||
(draw-sprite-batch sprite-batch))
|
(draw-sprite-batch sprite-batch))
|
||||||
|
|
||||||
|
|
||||||
(define (render-victory)
|
(define (render-victory)
|
||||||
(draw-sprite victory-image (vec2 0 0)))
|
(draw-sprite (assets-load-image "victory.jpg") (vec2 0 0)))
|
||||||
|
|
||||||
(define (render-defeat)
|
(define (render-defeat)
|
||||||
(draw-sprite defeat-image (vec2 0 0)))
|
(draw-sprite (assets-load-image "defeat.jpg") (vec2 0 0)))
|
||||||
|
|
||||||
(test-begin "tile-translation")
|
(test-begin "tile translation")
|
||||||
|
|
||||||
(test-equal (level-tile-index 'empty) empty-index)
|
(test-equal (level-tile-index 'empty) empty-index)
|
||||||
(test-equal (level-tile-index 'brick) 3750)
|
(test-equal (level-tile-index 'brick) 3750)
|
||||||
|
@ -94,4 +94,4 @@
|
||||||
(test-equal (level-tile-index 'goal) empty-index)
|
(test-equal (level-tile-index 'goal) empty-index)
|
||||||
(test-equal (level-tile-index 'unknown) 3326)
|
(test-equal (level-tile-index 'unknown) 3326)
|
||||||
|
|
||||||
(test-end "tile-translation")
|
(test-end "tile translation")
|
||||||
|
|
|
@ -3,18 +3,7 @@
|
||||||
#:use-module (ice-9 textual-ports)
|
#:use-module (ice-9 textual-ports)
|
||||||
#:use-module (chickadee graphics texture)
|
#:use-module (chickadee graphics texture)
|
||||||
#:use-module (chickadee graphics color)
|
#:use-module (chickadee graphics color)
|
||||||
#:export (
|
#:export (assets-load assets-load-image tile-texture tile-atlas hero-texture hero-atlas assets-map-levels read-level-map)
|
||||||
assets-load
|
|
||||||
assets-load-image
|
|
||||||
tile-texture
|
|
||||||
tile-atlas
|
|
||||||
hero-texture
|
|
||||||
hero-atlas
|
|
||||||
assets-map-levels
|
|
||||||
read-level-map
|
|
||||||
defeat-image
|
|
||||||
victory-image
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,9 +13,6 @@
|
||||||
(define hero-texture #f)
|
(define hero-texture #f)
|
||||||
(define hero-atlas #f)
|
(define hero-atlas #f)
|
||||||
|
|
||||||
(define defeat-image #f)
|
|
||||||
(define victory-image #f)
|
|
||||||
|
|
||||||
(define (assets-location)
|
(define (assets-location)
|
||||||
"find the location of the assets directory. The location is specified
|
"find the location of the assets directory. The location is specified
|
||||||
by the ASSET_DIR environment variable, or defaults to 'assets' in the
|
by the ASSET_DIR environment variable, or defaults to 'assets' in the
|
||||||
|
@ -72,8 +58,4 @@
|
||||||
(set! tile-atlas (split-texture tile-texture 16 16))
|
(set! tile-atlas (split-texture tile-texture 16 16))
|
||||||
|
|
||||||
(set! hero-texture (assets-load-image "lr_penguin2.png"))
|
(set! hero-texture (assets-load-image "lr_penguin2.png"))
|
||||||
(set! hero-atlas (split-texture hero-texture 32 32))
|
(set! hero-atlas (split-texture hero-texture 32 32)))
|
||||||
|
|
||||||
(set! defeat-image (assets-load-image "defeat.jpg"))
|
|
||||||
(set! victory-image (assets-load-image "victory.jpg"))
|
|
||||||
)
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ if [ -f "$SOURCETAR" ]; then
|
||||||
if [ -f $TARBALL ]; then
|
if [ -f $TARBALL ]; then
|
||||||
TARGETNAME=/tmp/bloatrunner
|
TARGETNAME=/tmp/bloatrunner
|
||||||
echo unpack $TARBALL to $TARGETNAME
|
echo unpack $TARBALL to $TARGETNAME
|
||||||
rm -rf $TARGETNAME
|
rm -f $TARGETNAME
|
||||||
mkdir -p $TARGETNAME
|
mkdir -p $TARGETNAME
|
||||||
|
|
||||||
tar -xzvf $TARBALL -C $TARGETNAME
|
tar -xzvf $TARBALL -C $TARGETNAME
|
||||||
|
|
Loading…
Reference in a new issue