Update example to reflect API change
This commit is contained in:
10
README.md
10
README.md
@@ -60,12 +60,10 @@ There are currently no tutorials or generated docs, because play-clj is changing
|
|||||||
; this function runs when the screen dimensions change
|
; this function runs when the screen dimensions change
|
||||||
:on-resize
|
:on-resize
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
; make the camera 20 tiles high, and adjust the width appropriately
|
; make the camera 20 tiles high, while maintaining the aspect ratio
|
||||||
(let [height 20
|
(height! screen 20)
|
||||||
width (* height (/ (game :width) (game :height)))]
|
; you can return nil if you didn't change any entities
|
||||||
(resize-camera! screen width height))
|
nil))
|
||||||
; return the entities list unmodified
|
|
||||||
entities))
|
|
||||||
|
|
||||||
; define the game itself, and immediately hand off to the screen
|
; define the game itself, and immediately hand off to the screen
|
||||||
(defgame game-test
|
(defgame game-test
|
||||||
|
|||||||
Reference in New Issue
Block a user