X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2F__init__.py;h=f06d0868dd78b5a6b79f05b52eaad2c49e739299;hp=9dc15d1d5ce5743d4e98423bbe04605c05e72df9;hb=41f351faf847cb5bc88c7ff5fc6c21bafc9aa5ee;hpb=3674933e0881e379e9945f5477cbef187abfc871 diff --git a/bulletml/__init__.py b/bulletml/__init__.py index 9dc15d1..f06d086 100644 --- a/bulletml/__init__.py +++ b/bulletml/__init__.py @@ -1,6 +1,35 @@ """BulletML parser. -http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html +This module parses and runs BulletML scripts. BulletML is a markup +language for describing complex bullet patterns in shooting games. +More information is available at the BulletML homepage, +http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html. + +Basic Usage: + + from bulletml import Bullet, BulletML + doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU")) + rank = 0.5 # Player difficulty, 0 to 1 + params = [] # Initial variable settings, usually empty + actions = [a(params, rank) for a in doc.top] + bullet = Bullet(x, y, target=player, actions=actions, rank=rank) + bullets = [bullet] + ... + for bullet in bullets: + bullets.extend(bullet.step()) + + ... + +For drawing, you're on your own, but Bullet has a number of +attributes that can be used to influence it. + """ from bulletml.parser import BulletML +from bulletml.impl import Bullet + +VERSION = (1, 0) +VERSION_STRING = ".".join(map(str, VERSION)) + +__all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML"] +