(rotation-multi-example game)

Example

(loop [i 0 entity (-> entity (assoc :viewport {:x 0, :y 0, :width game-width, :height game-height}) (play-cljc.transforms/project game-width game-height) (play-cljc.transforms/color [1 0 0.5 1]))] (when (< i 5) (let [entity (-> entity (play-cljc.transforms/translate tx ty) (play-cljc.transforms/rotate r))] (play-cljc.gl.core/render game entity) (recur (inc i) entity))))

Source

(defn rotation-multi-example [game] (gl game disable (gl game CULL_FACE)) (gl game disable (gl game DEPTH_TEST)) (let [entity (c/compile game (e/->entity game data/f-2d)) tx 100 ty 100 *state (atom {:tx tx, :ty ty, :r 0})] (eu/listen-for-mouse game *state) (assoc game :entity entity :*state *state)))