示例#1
0
 def create_missile(self):
     random_int = random.randint(0,3)
     if random_int < 2:
         if random_int == 0:
             direction = self.south
             move_to = UP
         else:
             direction = self.north
             move_to = DOWN
         position = (
             random.randint(260,370),
             direction,
             15,
             40
         )
     else:
         if random_int == 2:
             direction = self.ouest
             move_to = RIGHT
         else:
             direction = self.east
             move_to = LEFT
         position = (
             direction,
             random.randint(180,280),
             40,
             15
         )
     missile = Missile(
         2,
         position,
     )
     missile.direction_set(move_to)
     return missile