projects
/
python-bulletml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Python 3 incompatibility.
[python-bulletml.git]
/
bulletml
/
__init__.py
diff --git
a/bulletml/__init__.py
b/bulletml/__init__.py
index
27faaf0
..
8ab4ec2
100644
(file)
--- a/
bulletml/__init__.py
+++ b/
bulletml/__init__.py
@@
-17,15
+17,13
@@
Basic Usage:
from bulletml import Bullet, BulletML
doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
from bulletml import Bullet, BulletML
doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
+ player = ... # On your own here, but it needs x and y fields.
rank = 0.5 # Player difficulty, 0 to 1
rank = 0.5 # Player difficulty, 0 to 1
- params = [] # Initial variable settings, usually empty
- actions = [a(params, rank) for a in doc.actions]
- bullet = Bullet(x, y, target=player, actions=actions, rank=rank)
+ bullet = Bullet.FromDocument(doc, x, y, target=player, rank=rank)
bullets = [bullet]
...
for bullet in bullets:
bullets.extend(bullet.step())
bullets = [bullet]
...
for bullet in bullets:
bullets.extend(bullet.step())
-
...
For drawing, you're on your own, but Bullet instances have a number of
...
For drawing, you're on your own, but Bullet instances have a number of