Documentation.
[python-bulletml.git] / bulletml / __init__.py
1 """BulletML parser.
2
3 This module parses and runs BulletML scripts. BulletML is a markup
4 language for describing complex bullet patterns in shooting games.
5 More information is available at the BulletML homepage,
6 http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html.
7
8 Basic Usage:
9
10 from bulletml import Bullet, BulletML
11 doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
12 rank = 0.5 # Player difficulty, 0 to 1
13 params = [] # Initial variable settings, usually empty
14 actions = [a(params, rank) for a in doc.top]
15 bullet = Bullet(x, y, target=player, actions=actions, rank=rank)
16 bullets = [bullet]
17 ...
18 for bullet in bullets:
19 bullets.extend(bullet.step())
20
21 ...
22
23 For drawing, you're on your own, but Bullet has a number of
24 attributes that can be used to influence it.
25
26 """
27
28 from bulletml.parser import BulletML
29 from bulletml.impl import Bullet
30
31 VERSION = (1, 0)
32 VERSION_STRING = ".".join(map(str, VERSION))
33
34 __all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML"]
35