Mercurial > touhou
comparison pytouhou/game/laser.py @ 281:13dcde917083
Fix bullet spawning along lasers.
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Fri, 10 Feb 2012 11:01:11 +0100 |
parents | 3539520fff93 |
children | 18e4ed141dd8 |
comparison
equal
deleted
inserted
replaced
280:e04c3e1957c8 | 281:13dcde917083 |
---|---|
73 #TODO: check | 73 #TODO: check |
74 length = min(self.end_offset - self.start_offset, self.max_length) | 74 length = min(self.end_offset - self.start_offset, self.max_length) |
75 offset = self.end_offset - length | 75 offset = self.end_offset - length |
76 dx, dy = cos(self.angle), sin(self.angle) | 76 dx, dy = cos(self.angle), sin(self.angle) |
77 while self.start_offset <= offset < self.end_offset: | 77 while self.start_offset <= offset < self.end_offset: |
78 yield (self.x + offset * dx, self.y + offset * dy) | 78 yield (self.base_pos[0] + offset * dx, self.base_pos[1] + offset * dy) |
79 offset += 48. | 79 offset += 48. |
80 | 80 |
81 | 81 |
82 def cancel(self): | 82 def cancel(self): |
83 if self.state != STOPPING: | 83 if self.state != STOPPING: |