From 466a11f408b9b30cd0c01c34ec6abd0a148d4b22 Mon Sep 17 00:00:00 2001 From: oakes Date: Tue, 26 Aug 2014 23:42:41 -0400 Subject: [PATCH] Introduce (game :point-x) and (game :point-y) to preserve backwards compatibility --- src/play_clj/core_basics.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/play_clj/core_basics.clj b/src/play_clj/core_basics.clj index fd0585f..19bfbfe 100644 --- a/src/play_clj/core_basics.clj +++ b/src/play_clj/core_basics.clj @@ -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