예제 #1
0
  def __init__(self, game):
    super(Player, self).__init__()
    self.speed = 300
    self.game  = game
    self.size  = game.size
    self.color = Color.WHITE()

    # bullet options
    self.spawnrate = self.game.fps / 1.5
    self.spawntick = 0

    # size dimensions
    w, h = 64, 32
    x = game.width  / 2. - (w / 2.)
    y = game.height / 10. * 9.
    self.rect = pygame.Rect(x, y, w, h)
예제 #2
0
 def __init__(self, x=0, y=0):
   super(Bullet, self).__init__()
   self.speed = 400
   self.color = Color.WHITE()
   self.rect = pygame.Rect(x, y, 8, 16)
예제 #3
0
 def __init__(self, string, x=0, y=0, w=0, h=0):
     self.color = Color.WHITE()
     self.x, self.y, self.w, self.h = x, y, w, h
     self.set_text(string)