# HG changeset patch # User Thibaut Girka # Date 1313057628 -7200 # Node ID 6ebf9539c0774e46cbe92b7d76018e1d2acca2f7 # Parent ca7886296d4a8c2a7feceda34706e5f7bc7d0a1f Handle more enemies types and movements diff --git a/pytouhou/formats/ecl.py b/pytouhou/formats/ecl.py --- a/pytouhou/formats/ecl.py +++ b/pytouhou/formats/ecl.py @@ -42,9 +42,7 @@ class ECL(object): break sub, instr_type, size = unpack(' abs(dy): + pass #TODO + else: + pass #TODO + self.x, self.y = x, y self.speed += self.acceleration #TODO: units? Execution order? self.angle += self.rotation_speed #TODO: units? Execution order? dx, dy = cos(self.angle) * self.speed, sin(self.angle) * self.speed - if self.type == 2: + if self.type & 2: self.x -= dx else: self.x += dx @@ -95,7 +118,7 @@ class EnemyManager(object): def update(self, frame): if self.main and self.main[0][0] == frame: for sub, instr_type, args in self.main.pop(0)[1]: - if instr_type in (0, 2): # Normal/mirrored enemy + if instr_type in (0, 2, 4, 6): # Normal/mirrored enemy x, y, z, life, unknown1, unknown2, unknown3 = args self.enemies.append(Enemy((x, y), life, instr_type, self.subs[sub], self.anims)) diff --git a/pytouhou/utils/interpolator.py b/pytouhou/utils/interpolator.py --- a/pytouhou/utils/interpolator.py +++ b/pytouhou/utils/interpolator.py @@ -34,3 +34,4 @@ class Interpolator(object): truc = float(frame - self.start_frame) / float(self.end_frame - self.start_frame) self.values = tuple(start_value + truc * (end_value - start_value) for (start_value, end_value) in zip(self.start_values, self.end_values)) +