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
7
game.scm
7
game.scm
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue