Introduce (game :point-x) and (game :point-y) to preserve backwards compatibility

This commit is contained in:
oakes
2014-08-26 23:42:41 -04:00
parent c3f74d97f7
commit 466a11f408

View File

@@ -94,15 +94,17 @@
"Provides quick access to often-used functions.
(game :width)"
[k]
[k & [arg]]
(case k
:width (graphics! :get-width)
:height (graphics! :get-height)
:fps (graphics! :get-frames-per-second)
:fullscreen? (graphics! :is-fullscreen)
:touched? (input! :is-touched)
:x (input! :get-x)
:y (- (graphics! :get-height) (input! :get-y))
:x (input! :get-x) ; deprecated, use :point-x instead
:y (input! :get-y) ; deprecated, use :point-y instead (it is flipped)
:point-x (input! :get-x (or arg 0))
:point-y (- (graphics! :get-height) (input! :get-y (or arg 0)))
(u/throw-key-not-found k)))
(defmacro key-code