Compare commits
No commits in common. "f8647695a0cc6bb96ec65fa60053f4e369ed148c" and "e71b0bb15875937e5acf01aa2526303d4fe3f160" have entirely different histories.
f8647695a0
...
e71b0bb158
8 changed files with 54 additions and 63 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -14,4 +14,3 @@
|
|||
/gnu/
|
||||
/bloatrunner
|
||||
/*.tar.gz
|
||||
publish
|
||||
|
|
|
@ -9,7 +9,6 @@ AM_SILENT_RULES([yes])
|
|||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
|
||||
AC_CONFIG_FILES([bloatrunner], [chmod +x bloatrunner])
|
||||
AC_CONFIG_FILES([publish], [chmod +x publish])
|
||||
|
||||
GUILE_PKG([3.0])
|
||||
GUILE_PROGS
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
(%make-level width height tiles)))
|
||||
|
||||
(define (level-parse-file filename)
|
||||
(level-parse (call-with-input-file filename get-string-all)))
|
||||
(level-parse (call-with-input-file (assets-file-name filename) get-string-all)))
|
||||
|
||||
|
||||
(define (level-tile-at-row-col level row col )
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
(define (food-index food cycle)
|
||||
(let ((x (coord->cell (vec2-x (food-position food))))
|
||||
(y (coord->cell (vec2-y (food-position food)))))
|
||||
(remainder (+ (* x 37) (* 73 y)) cycle)))
|
||||
(pk "food remainder : " (remainder (+ (* x 37) (* 73 y)) cycle))))
|
||||
|
||||
(define (render-food food)
|
||||
(let ((index (food-index food (if (food-healthy? food) healthy-food-cycle bad-food-cycle)))
|
||||
|
|
|
@ -63,13 +63,17 @@
|
|||
(if (equal? tile 'ladder)
|
||||
;; add background behind ladder
|
||||
(if (or (equal? (level-tile-at level (vec2+ position (vec2 16 0))) 'brick)
|
||||
(equal? (level-tile-at level (vec2- position (vec2 -16 0))) 'brick))
|
||||
(equal? (level-tile-at level (vec2- position (vec2 -16 0))) 'brick)
|
||||
|
||||
)
|
||||
(sprite-batch-add! sprite-batch position
|
||||
#:texture-region (texture-atlas-ref tile-atlas brick-index))
|
||||
(sprite-batch-add! sprite-batch position
|
||||
#:texture-region (texture-atlas-ref tile-atlas empty-index))))
|
||||
|
||||
(sprite-batch-add! sprite-batch position
|
||||
#:texture-region texture-region)))
|
||||
|
||||
(iota (level-width level) 0)))
|
||||
(iota (level-height level) 0)))
|
||||
|
||||
|
@ -80,10 +84,10 @@
|
|||
|
||||
|
||||
(define (render-victory)
|
||||
(draw-sprite (assets-load-image "victory.jpg") (vec2 0 0)))
|
||||
(draw-sprite (load-image (assets-file-name "assets/images/victory.jpg")) (vec2 0 0)))
|
||||
|
||||
(define (render-defeat)
|
||||
(draw-sprite (assets-load-image "defeat.jpg") (vec2 0 0)))
|
||||
(draw-sprite (load-image (assets-file-name "assets/images/defeat.jpg")) (vec2 0 0)))
|
||||
|
||||
(test-begin "tile translation")
|
||||
|
||||
|
|
|
@ -13,36 +13,26 @@
|
|||
(define hero-texture #f)
|
||||
(define hero-atlas #f)
|
||||
|
||||
(define (assets-location)
|
||||
(pk "Assets location: "
|
||||
(if (current-filename)
|
||||
(string-append (dirname (current-filename)) "/../../assets")
|
||||
(or (getenv "ASSET_DIR") "." )))
|
||||
)
|
||||
(define prefix (or (getenv "ASSET_DIR") "." ))
|
||||
|
||||
(define (assets-file-name . names)
|
||||
"Return the full path of a file in the assets directory. The file is
|
||||
specified by a list of names, which are joined together. The
|
||||
ASSET_DIR environment variable can be used to specify a prefix to the
|
||||
asset directory."
|
||||
(string-append (assets-location) "/" (string-join names "/")))
|
||||
|
||||
(define (assets-file-name name)
|
||||
(string-append prefix "/" name)
|
||||
)
|
||||
|
||||
|
||||
(define (read-level-map filename)
|
||||
(call-with-input-file filename get-string-all))
|
||||
(call-with-input-file get-string-all))
|
||||
|
||||
(define (assets-map-levels f)
|
||||
(map f
|
||||
(map (lambda (filename)(assets-file-name "levels" filename))
|
||||
(scandir (assets-file-name "levels")
|
||||
(map (lambda (filename)(string-append prefix "/assets/levels/" filename))
|
||||
(scandir (assets-file-name "assets/levels")
|
||||
(lambda (filename) (string-suffix? ".map" filename ))))))
|
||||
|
||||
(define (assets-load-image filename)
|
||||
(load-image (assets-file-name "images" filename)))
|
||||
|
||||
(define (assets-load)
|
||||
(set! tile-texture (assets-load-image "simples_pimples.png"))
|
||||
(set! tile-texture (load-image (assets-file-name "assets/images/simples_pimples.png")))
|
||||
(set! tile-atlas (split-texture tile-texture 16 16))
|
||||
|
||||
(set! hero-texture (assets-load-image "lr_penguin2.png"))
|
||||
(set! hero-texture (load-image (assets-file-name "assets/images/lr_penguin2.png")))
|
||||
(set! hero-atlas (split-texture hero-texture 32 32)))
|
||||
|
|
36
publish.in
36
publish.in
|
@ -1,36 +0,0 @@
|
|||
|
||||
ITCH_CHANNEL=snamellit/Bloatrunner
|
||||
|
||||
if [[ ! -f Makefile ]]; then
|
||||
make distclean
|
||||
fi
|
||||
|
||||
./bootstrap.sh
|
||||
./configure GUILE=$(which guile)
|
||||
make -j16
|
||||
make dist
|
||||
|
||||
SOURCETAR="@PACKAGE@-@VERSION@.tar.gz"
|
||||
|
||||
if [ -f "$SOURCETAR" ]; then
|
||||
echo "Found source tarball $SOURCE"
|
||||
BASENAME="@PACKAGE@-@VERSION@"
|
||||
|
||||
echo releasing $BASENAME
|
||||
|
||||
butler push $SOURCETAR $ITCH_CHANNEL:source
|
||||
|
||||
TARBALL=$(guix pack -R -Sbloatrunner=bin -L .guix/modules bloatrunner)
|
||||
echo created $TARBALL
|
||||
TARGETNAME=/tmp/$BASENAME-linux-x86_64.tar.gz
|
||||
echo copy $TARBALL to $TARGETNAME
|
||||
rm -f $TARGETNAME
|
||||
cp $TARBALL $TARGETNAME
|
||||
|
||||
echo push $TARGETNAME
|
||||
butler push $TARGETNAME $ITCH_CHANNEL:linux-x86_64
|
||||
|
||||
else
|
||||
echo "No source tarball found"
|
||||
exit 1
|
||||
fi
|
35
publish.sh
Executable file
35
publish.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
|
||||
ITCH_CHANNEL=snamellit/Bloatrunner
|
||||
|
||||
if [[ ! -f Makefile ]]; then
|
||||
make distclean
|
||||
fi
|
||||
|
||||
./bootstrap.sh
|
||||
./configure GUILE=$(which guile)
|
||||
make -j16
|
||||
make dist
|
||||
|
||||
SOURCETAR=$(ls bloatrunner-*.tar.gz | head -n 1)
|
||||
|
||||
if [ -f "$SOURCETAR" ]; then
|
||||
echo "Found source tarball $SOURCE"
|
||||
BASENAME=$(basename $SOURCETAR .tar.gz)
|
||||
echo releasing $BASENAME
|
||||
|
||||
butler push $SOURCETAR $ITCH_CHANNEL:source
|
||||
|
||||
TARBALL=$(guix pack -R -Sbloatrunner=bin -L .guix/modules bloatrunner)
|
||||
echo created $TARBALL
|
||||
TARGETNAME=/tmp/$BASENAME-linux-x86_64.tar.gz
|
||||
echo copy $TARBALL to $TARGETNAME
|
||||
rm -f $TARGETNAME
|
||||
cp $TARBALL $TARGETNAME
|
||||
|
||||
echo push $TARGETNAME
|
||||
butler push $TARGETNAME $ITCH_CHANNEL:linux-x86_64
|
||||
|
||||
else
|
||||
echo "No source tarball found"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue