X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2F__init__.py;h=c31dce7640a84f27245e987beeeb6e87e9906f4e;hp=27faaf03364a52efd3f89b8eb8c3108fe4a1e85e;hb=bf5ff1d116840e1330c80894132919ec515596e4;hpb=405e333fe99b3625b0d89565de4e83984b462a3e diff --git a/bulletml/__init__.py b/bulletml/__init__.py index 27faaf0..c31dce7 100644 --- a/bulletml/__init__.py +++ b/bulletml/__init__.py @@ -9,6 +9,9 @@ renderer-agnostic. In addition to the standard BulletML XML format, this module supports an equivalent YAML format. See bulletml.bulletyaml for more details. +Finally, two simple collision routines are provided, bulletml.overlaps +for stationary circles and bulletml.collides for moving circles. + More information is available at the BulletML homepage, http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html, or the python-bullet homepage, http://code.google.com/p/python-bulletml/. @@ -17,15 +20,13 @@ Basic Usage: from bulletml import Bullet, BulletML doc = Bulletml.BulletML.FromDocument(open("test.xml", "rU")) + player = ... # On your own here, but it needs x and y fields. rank = 0.5 # Player difficulty, 0 to 1 - params = [] # Initial variable settings, usually empty - actions = [a(params, rank) for a in doc.actions] - bullet = Bullet(x, y, target=player, actions=actions, rank=rank) + bullet = Bullet.FromDocument(doc, x, y, target=player, rank=rank) bullets = [bullet] ... for bullet in bullets: bullets.extend(bullet.step()) - ... For drawing, you're on your own, but Bullet instances have a number of @@ -35,9 +36,11 @@ attributes that can be used to influence it. from bulletml.parser import BulletML from bulletml.impl import Bullet +from bulletml.collision import overlaps, collides -VERSION = (0, 1) +VERSION = (1,) VERSION_STRING = ".".join(map(str, VERSION)) -__all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML"] +__all__ = ["VERSION", "VERSION_STRING", "Bullet", "BulletML", + "overlaps", "collides"]