X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2Fimpl.py;h=98b0ef75547a6e55baea75526c30e801cec47be4;hp=a056d6c4390642ed78e0a3cb013eccdd5c92fb1d;hb=ba81e7d74da58dc8dfa47949502d2a2759c84309;hpb=9b685c2cd942cb5b1b0c0c400d9493419730df46 diff --git a/bulletml/impl.py b/bulletml/impl.py index a056d6c..98b0ef7 100644 --- a/bulletml/impl.py +++ b/bulletml/impl.py @@ -73,10 +73,13 @@ class Action(object): self.owner.speed += self.speed if self.direction_frames > 0: + # The Noiz implementation was a little weird here, I think + # there was a bug in it that prevented it from working if + # the frame count was 1. I'm still not sure what the aim + # check is supposed to do, exactly. self.direction_frames -= 1 - if self.direction_frames <= 0: - if self.aiming: - self.owner.direction += self.owner.aim + if self.aiming and self.direction_frames <= 0: + self.owner.direction += self.owner.aim else: self.owner.direction += self.direction @@ -305,10 +308,3 @@ class Bullet(object): self.y += self.my - math.cos(self.direction) * self.speed return created - - @classmethod - def FromDoc(cls, doc, params=(), x=0, y=0, speed=0, direction=0, - target=None, rank=0.5): - """Construct a bullet from top-level actions in a document.""" - actions = [act(params, rank) for act in doc.top] - return cls(x, y, direction, speed, target, actions, rank=rank)