Bullet.FromDocument: Abstract weird constructor handling.
[python-bulletml.git] / bulletml / __init__.py
index 27faaf0..8ab4ec2 100644 (file)
@@ -17,15 +17,13 @@ Basic Usage:
 
     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
-    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())
-
     ...
 
 For drawing, you're on your own, but Bullet instances have a number of