Export tileset and test rendering a tile.

This commit is contained in:
David Thompson 2024-05-17 17:58:43 -04:00
parent 3e4f5b4fe5
commit b9f9e81381
3 changed files with 9 additions and 4 deletions

View file

@ -1,5 +1,3 @@
All images by Kenney
Artwork by Christine Lemmer-Webber
Licensed under CC0
https://kenney.nl/assets/puzzle-pack
Licensed under ?????

BIN
assets/images/cirkoban.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -34,6 +34,10 @@
(define game-width 320.0)
(define game-height 240.0)
(define tile-width 16.0)
(define tile-height 16.0)
(define image:tiles (make-image "assets/images/cirkoban.png"))
(define dt (/ 1000.0 60.0)) ; aim for updating at 60Hz
(define (update)
@ -57,6 +61,9 @@
(set-font! context "bold 24px monospace")
(set-text-align! context "left")
(fill-text context "HELLO" 16.0 36.0)
(draw-image context image:tiles
0.0 0.0 tile-width tile-height
100.0 100.0 tile-width tile-height)
(request-animation-frame draw-callback))
(define draw-callback (procedure->external draw))