diff --git a/README.md b/README.md index bace99d..d5664b4 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ For now, check out the [example projects](https://github.com/oakes/play-clj-exam ; update the screen map to hold a tiled map renderer and a camera (update! screen :renderer (orthogonal-tiled-map "level1.tmx" (/ 1 8)) - :camera (orthographic-camera)) + :camera (orthographic)) (let [; load a sprite sheet from your resources dir sheet (texture "tiles.png") ; split the sheet into 16x16 tiles diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 3973753..b0add36 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -212,27 +212,27 @@ ; cameras -(defn orthographic-camera* +(defn orthographic* [] (OrthographicCamera.)) -(defmacro orthographic-camera +(defmacro orthographic [& options] - `(u/calls! ^OrthographicCamera (orthographic-camera*) ~@options)) + `(u/calls! ^OrthographicCamera (orthographic*) ~@options)) -(defmacro orthographic-camera! +(defmacro orthographic! [screen k & options] `(u/call! ^OrthographicCamera (:camera ~screen) ~k ~@options)) -(defn perspective-camera +(defn perspective [] (PerspectiveCamera.)) -(defmacro perspective-camera +(defmacro perspective [& options] - `(u/calls! ^PerspectiveCamera (perspective-camera*) ~@options)) + `(u/calls! ^PerspectiveCamera (perspective*) ~@options)) -(defmacro perspective-camera! +(defmacro perspective! [screen k & options] `(u/call! ^PerspectiveCamera (:camera ~screen) ~k ~@options)) diff --git a/src/play_clj/g2d_physics.clj b/src/play_clj/g2d_physics.clj index 0f34e7d..da93a27 100644 --- a/src/play_clj/g2d_physics.clj +++ b/src/play_clj/g2d_physics.clj @@ -3,20 +3,20 @@ [play-clj.utils :as u]) (:import [com.badlogic.gdx.physics.box2d World])) -(defn world* +(defn box2d* ([] - (world* 0 0 true)) + (box2d* 0 0 true)) ([gravity-x gravity-y] - (world* gravity-x gravity-y true)) + (box2d* gravity-x gravity-y true)) ([gravity-x gravity-y sleep?] (World. (m/vector-2 gravity-x gravity-y) sleep?))) -(defmacro world +(defmacro box2d [gravity-x gravity-y & options] - `(let [object# (world* ~gravity-x ~gravity-y)] + `(let [object# (box2d* ~gravity-x ~gravity-y)] (u/calls! ^World object# ~@options) object#)) -(defmacro world! +(defmacro box2d! [{:keys [^World world]} k & options] `(u/call! ^World ~world ~k ~@options))