Export tileset and test rendering a tile.
This commit is contained in:
parent
3e4f5b4fe5
commit
b9f9e81381
3 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,3 @@
|
||||||
All images by Kenney
|
Artwork by Christine Lemmer-Webber
|
||||||
|
|
||||||
Licensed under CC0
|
Licensed under ?????
|
||||||
|
|
||||||
https://kenney.nl/assets/puzzle-pack
|
|
||||||
|
|
BIN
assets/images/cirkoban.png
Normal file
BIN
assets/images/cirkoban.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
7
game.scm
7
game.scm
|
@ -34,6 +34,10 @@
|
||||||
|
|
||||||
(define game-width 320.0)
|
(define game-width 320.0)
|
||||||
(define game-height 240.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 dt (/ 1000.0 60.0)) ; aim for updating at 60Hz
|
||||||
(define (update)
|
(define (update)
|
||||||
|
@ -57,6 +61,9 @@
|
||||||
(set-font! context "bold 24px monospace")
|
(set-font! context "bold 24px monospace")
|
||||||
(set-text-align! context "left")
|
(set-text-align! context "left")
|
||||||
(fill-text context "HELLO" 16.0 36.0)
|
(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))
|
(request-animation-frame draw-callback))
|
||||||
(define draw-callback (procedure->external draw))
|
(define draw-callback (procedure->external draw))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue