comparison org/games.org @ 50:b1b90c4ab0bf

trying to resolve problem with skeleton debugging
author Robert McIntyre <rlm@mit.edu>
date Mon, 14 Nov 2011 18:46:34 -0700
parents 183744c179e6
children 1381a6ebd08b
comparison
equal deleted inserted replaced
49:96a41b384100 50:b1b90c4ab0bf
152 (fn [game value] 152 (fn [game value]
153 (println-repl "set gravity to " new-value) 153 (println-repl "set gravity to " new-value)
154 (if value 154 (if value
155 (set-gravity game new-value) 155 (set-gravity game new-value)
156 (set-gravity game gravity)))) 156 (set-gravity game gravity))))
157
158 (defn fire-cannon-ball
159 ([node]
160 (fn [game value]
161 (if (not value)
162 (let [camera (.getCamera game)
163 cannon-ball
164 (sphere 0.7
165 :material "Common/MatDefs/Misc/Unshaded.j3md"
166 :texture "Textures/PokeCopper.jpg"
167 :position
168 (.add (.getLocation camera)
169 (.mult (.getDirection camera) (float 1)))
170 :mass 3)] ;200 0.05
171 (.setShadowMode cannon-ball RenderQueue$ShadowMode/CastAndReceive)
172 (.setLinearVelocity
173 (.getControl cannon-ball RigidBodyControl)
174 (.mult (.getDirection camera) (float 50))) ;50
175 (add-element game cannon-ball (if node node (.getRootNode game)))))))
176 ([]
177 (fire-cannon-ball false)))
178
179 157
180 (defn floor* [] 158 (defn floor* []
181 (doto (box 10 0.1 5 :name "floor" ;10 0.1 5 ; 240 0.1 240 159 (doto (box 10 0.1 5 :name "floor" ;10 0.1 5 ; 240 0.1 240
182 :material "Common/MatDefs/Misc/Unshaded.j3md" 160 :material "Common/MatDefs/Misc/Unshaded.j3md"
183 :texture "Textures/Terrain/Pond/Pond.png" 161 :texture "Textures/Terrain/Pond/Pond.png"