コード例 #1
0
ファイル: sprites.py プロジェクト: nthykier/CronoShift
    def walk_animation(self):
        """Animation for the player walking."""

        # This animation is hardcoded for 4 frames and 16x24 map tiles
        d = self.direction
        dpos = Direction.dir_update(d)
        for frame in range(4):
            if d < len(self.frames) and frame < len(self.frames[d]):
                self.image = self.frames[d][frame]
            else:
                self.image = self.frames[0][0]
            yield None
            self.move(Position(3 * dpos.x, 2 * dpos.y))
            yield None
            self.move(Position(3 * dpos.x, 2 * dpos.y))
コード例 #2
0
ファイル: position.py プロジェクト: nthykier/CronoShift
 def dir_pos(self, direction):
     return self + Direction.dir_update(direction)