예제 #1
0
 def update(self, world):
     if not self.time:
         p = world.get_p(self.x, self.y)
         if p.x < self.x:
             world.e.append(Entities.CannonBall(self.x, self.y, -1))
             shot.play()
         elif p.x > self.x:
             world.e.append(Entities.CannonBall(self.x, self.y, 1))
             shot.play()
         self.time = randint(120, 360)
     else:
         self.time -= 1