Bullet.FromDocument: Abstract weird constructor handling.
[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 More information is available at the BulletML homepage,
13 http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html, or the
14 python-bullet homepage, http://code.google.com/p/python-bulletml/.
15
16 Basic Usage:
17
18 from bulletml import Bullet, BulletML
19 doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
20 player = ... # On your own here, but it needs x and y fields.
21 rank = 0.5 # Player difficulty, 0 to 1
22 bullet = Bullet.FromDocument(doc, x, y, target=player, rank=rank)
23 bullets = [bullet]
24 ...
25 for bullet in bullets:
26 bullets.extend(bullet.step())
27 ...
28
29 For drawing, you're on your own, but Bullet instances have a number of
30 attributes that can be used to influence it.
31
32 """
33
34 from bulletml.parser import BulletML
35 from bulletml.impl import Bullet
36
37 VERSION = (0, 1)
38 VERSION_STRING = ".".join(map(str, VERSION))
39
40 __all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML"]
41