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 In addition to the standard BulletML XML format, this module supports
10 an equivalent YAML format. See bulletml.bulletyaml for more details.
12 Finally, three simple collision routines are provided:
13 bulletml.overlaps for stationary circles, bulletml.collides for moving
14 circles, and bulletml.collides_all for one moving circle against many
17 More information is available at the BulletML homepage,
18 http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html, or the
19 python-bullet homepage, http://code.google.com/p/python-bulletml/.
23 from bulletml import Bullet, BulletML
24 doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU"))
25 player = ... # On your own here, but it needs x and y fields.
26 rank = 0.5 # Player difficulty, 0 to 1
27 bullet = Bullet.FromDocument(doc, x, y, target=player, rank=rank)
30 for bullet in bullets:
31 bullets.extend(bullet.step())
34 For drawing, you're on your own, but Bullet instances have a number of
35 attributes that can be used to influence it.
39 from bulletml
.parser
import BulletML
40 from bulletml
.impl
import Bullet
41 from bulletml
.collision
import overlaps
, collides
, collides_all
44 VERSION_STRING
= ".".join(map(str, VERSION
))
46 __all__
= ["VERSION", "VERSION_STRING", "Bullet", "BulletML",
47 "overlaps", "collides", "collides_all"]