mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-06-09 23:29:40 +00:00
spruced up display of frames per second in animate
This commit is contained in:
parent
02eb04cae0
commit
3ba9aee7c6
|
@ -84,7 +84,7 @@
|
|||
"takes a world-sequence and animates it,
|
||||
using the :tick-duration to set the frame rate"
|
||||
[{:keys [worlds tick-duration]} print-width print-height]
|
||||
(let [frame-rate (Math/round (/ 1 tick-duration))]
|
||||
(let [frame-rate (/ 1 tick-duration)]
|
||||
(doseq [[world idx next-tick] (map
|
||||
vector
|
||||
worlds
|
||||
|
@ -97,7 +97,7 @@
|
|||
(println (str robot-idx ": "
|
||||
"x " (get-in world [:robots robot-idx :pos-x]) ", "
|
||||
"y " (get-in world [:robots robot-idx :pos-y]))))
|
||||
(println "Animation frame rate:" frame-rate)
|
||||
(println (format "Animation frame rate: %.1f frames per second", frame-rate))
|
||||
(println "World-tick number:" idx)
|
||||
)))
|
||||
;(Thread/sleep (* (time/in-secs (time/interval (time/now) next-tick)) 1000)))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user