projects
/
python-bulletml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8c89bca
)
Prevent divide by zero when the elapsed time is too small.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Thu, 18 Mar 2010 07:18:42 +0000
(
00:18
-0700)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Thu, 18 Mar 2010 07:18:42 +0000
(
00:18
-0700)
bulletml-runner
patch
|
blob
|
history
diff --git
a/bulletml-runner
b/bulletml-runner
index
de0fa5a
..
ec6007b
100755
(executable)
--- a/
bulletml-runner
+++ b/
bulletml-runner
@@
-85,12
+85,13
@@
def main(argv):
frames += 1
if frames % 100 == 0:
frames += 1
if frames % 100 == 0:
- seconds_per_bullet = elapsed / count
- bullets_per_second = count / elapsed
print " Processing: %04d: %d bullets, %d active." % (
frames, total, count)
print " Processing: %04d: %d bullets, %d active." % (
frames, total, count)
- print " %g seconds per bullet (60Hz max: %g)." % (
- seconds_per_bullet, bullets_per_second / 60)
+ if elapsed:
+ print " %g seconds per bullet (60Hz max: %g)." % (
+ seconds_per_bullet = elapsed / count
+ bullets_per_second = count / elapsed
+ seconds_per_bullet, bullets_per_second / 60)
screen.fill([0, 0, 0])
for obj in active:
screen.fill([0, 0, 0])
for obj in active: