Action: Don't need the owner in the constructor. Factory function to create a child.
[python-bulletml.git] / bulletml / __init__.py
1 """BulletML parser.
2
3 BulletML is the Bullet Markup Language. BulletML can describe the
4 barrage of bullets in shooting games. (For example Progear, Psyvariar,
5 Gigawing2, G DARIUS, XEVIOUS, ...) This module parses and executes
6 BulletML scripts in Python. All data structures in it are
7 renderer-agnostic.
8
9 In addition to the standard BulletML XML format, this module supports
10 an equivalent YAML format. See bulletml.bulletyaml for more details.
11
12 Finally, two simple collision routines are provided, bulletml.overlaps
13 for stationary circles and bulletml.collides for moving circles.
14
15 More information is available at the BulletML homepage,
16 http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html, or the
17 python-bullet homepage, http://code.google.com/p/python-bulletml/.
18
19 Basic Usage:
20
21 from bulletml import Bullet, BulletML
22 doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
23 player = ... # On your own here, but it needs x and y fields.
24 rank = 0.5 # Player difficulty, 0 to 1
25 bullet = Bullet.FromDocument(doc, x, y, target=player, rank=rank)
26 bullets = [bullet]
27 ...
28 for bullet in bullets:
29 bullets.extend(bullet.step())
30 ...
31
32 For drawing, you're on your own, but Bullet instances have a number of
33 attributes that can be used to influence it.
34
35 """
36
37 from bulletml.parser import BulletML
38 from bulletml.impl import Bullet
39 from bulletml.collision import overlaps, collides
40
41 VERSION = (1,)
42 VERSION_STRING = ".".join(map(str, VERSION))
43
44 __all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML",
45 "overlaps", "collides"]
46