This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defscreen main-screen | |
:on-show | |
(fn [screen entities] | |
(update! screen | |
:renderer (model-batch) | |
:attributes (let [attr-type (attribute-type :color :ambient-light) | |
attr (attribute :color attr-type 0.8 0.8 0.8 1)] | |
(environment :set attr)) | |
:camera (doto (perspective 75 (game :width) (game :height)) | |
(position! 0 0 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(print "Click the screen to create a new block.") | |
(def ^:const mass 10) | |
(defn get-environment | |
[] | |
(let [attr-type (attribute-type :color :ambient-light) | |
attr (attribute :color attr-type 0.3 0.3 0.3 1)] | |
(environment :set attr))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def ^:const pixels-per-tile 32) | |
(defn create-ball-body! | |
[screen radius] | |
(let [body (add-body! screen (body-def :dynamic))] | |
(->> (circle-shape :set-radius radius) | |
(fixture-def :density 1 :friction 0 :restitution 1 :shape) | |
(body! body :create-fixture)) | |
body)) |
NewerOlder