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