Mercurial > touhou
changeset 278:615c0bb6064b
Fix generation of bullets/items position from lasers.
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 06 Feb 2012 19:38:54 +0100 |
parents | 219edad0f395 |
children | 3539520fff93 |
files | pytouhou/game/laser.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pytouhou/game/laser.py +++ b/pytouhou/game/laser.py @@ -70,10 +70,10 @@ class Laser(object): def get_bullets_pos(self): #TODO: check - offset = self.start_offset length = min(self.end_offset - self.start_offset, self.max_length) + offset = self.end_offset - length dx, dy = cos(self.angle), sin(self.angle) - while 0 <= offset - self.start_offset <= length: + while self.start_offset <= offset < self.end_offset: yield (self.x + offset * dx, self.y + offset * dy) offset += 48.