c87a4425b43ac2889828c0695b97ea6a490579a8
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
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/.
13 If you want to use a YAML-based implementation, check out the
14 bulletml.bulletyaml module in this package.
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)
26 for bullet in bullets:
27 bullets.extend(bullet.step())
31 For drawing, you're on your own, but Bullet instances have a number of
32 attributes that can be used to influence it.
36 from bulletml
.parser
import BulletML
37 from bulletml
.impl
import Bullet
40 VERSION_STRING
= ".".join(map(str, VERSION
))
42 __all__
= ["VERSION", "VERSION_STRING", "Bullet", "BulletML"]