YAML wrapper.
[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 If you want to use a YAML-based implementation, check out the
14 bulletml.bulletyaml module in this package.
15
16 Basic Usage:
17
18 from bulletml import Bullet, BulletML
19 doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
20 rank = 0.5 # Player difficulty, 0 to 1
21 params = [] # Initial variable settings, usually empty
22 actions = [a(params, rank) for a in doc.top]
23 bullet = Bullet(x, y, target=player, actions=actions, rank=rank)
24 bullets = [bullet]
25 ...
26 for bullet in bullets:
27 bullets.extend(bullet.step())
28
29 ...
30
31 For drawing, you're on your own, but Bullet instances have a number of
32 attributes that can be used to influence it.
33
34 """
35
36 from bulletml.parser import BulletML
37 from bulletml.impl import Bullet
38
39 VERSION = (0, 1)
40 VERSION_STRING = ".".join(map(str, VERSION))
41
42 __all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML"]
43