(rand-rects-example game entity entities)

Example

(for [_ (range 50)] (-> entity (play-cljc.transforms/color [(rand) (rand) (rand) 1]) (play-cljc.transforms/translate (rand-int game-width) (rand-int game-height)) (play-cljc.transforms/scale (rand-int 300) (rand-int 300))))

Source

(defn rand-rects-example [game entity entities] (gl game disable (gl game CULL_FACE)) (gl game disable (gl game DEPTH_TEST)) (->> entities (reduce-kv i/assoc (i/->instanced-entity entity)) (c/compile game) (assoc game :entity)))