示例#1
0
	def __init__(self,bulletlist):
		Bullet.__init__(self,bulletlist)
		self.x=1
		self.xran = random.uniform(1,6)
		self.y=self.plot(self.x)
		self.bspeed=.6
		self.xspeed=.1
示例#2
0
    def __init__(self, ai_settings, screen, ship):
        Bullet.__init__(self, ai_settings, screen)  # Inherit from Bullet

        # Ship bullet position
        self.rect.centerx = ship.rect.centerx
        self.rect.top = ship.rect.top

        # Store the bullet's position as demical value
        self.y = float(self.rect.y)
示例#3
0
    def __init__(self, ai_settings, screen, alien):
        Bullet.__init__(self, ai_settings, screen)

        # Ship bullet position
        self.rect.centerx = alien.rect.centerx
        self.rect.bottom = alien.rect.bottom

        # Store the bullet's position as demical value
        self.y = float(self.rect.y)
示例#4
0
 def __init__(self, bulletlist, **kw):
     self.kw = kw
     Bullet.__init__(self, bulletlist)
     self.inc = .2
     self.c = 0
     self.width = 30
     self.speed = 10
     #print "kwargs are ",kw
     #print "kwargs are ",self.kw
     self.mid = self.kw['mid']
示例#5
0
 def __init__(self, bulletlist, **kw):
     self.kw = kw
     Bullet.__init__(self, bulletlist)
     self.inc = 0.2
     self.c = 0
     self.width = 30
     self.speed = 10
     # print "kwargs are ",kw
     # print "kwargs are ",self.kw
     self.mid = self.kw["mid"]
示例#6
0
	def __init__(self,width,height,enemies_num):
		self.width=width
		self.height= height
		self.step=0
		pygame.init()
		self.window=pygame.display.set_mode((self.width,self.height))
		self.back_ground=pygame.image.load('BG.png')
		self.bullet_sound=pygame.mixer.Sound("gunshot.wav")
		self.shell_sound=pygame.mixer.Sound("shell_falls.wav")
		self.background_music=pygame.mixer.music.load('background_music.wav')
		self.window.blit(self.back_ground,(0,0))
		pygame.display.update()
		AdventureGirl.__init__(self,self.width//2-200,self.height-270,self.window)
		Enemy.__init__(self,self.window)
		Bullet.__init__(self,0,0,self.window)
		self.clock=pygame.time.Clock()
		self.t1=threading.Thread(target=self.listen)
		self.t1.start()
		self.generate(enemies_num)
		self.t1.join()
示例#7
0
	def __init__(self, x, y):
		Bullet.__init__(self, x, y)
示例#8
0
	def __init__(self,x=0,y=0,width=5,height=5, **images) :
		Bullet.__init__ (self,x,y,width,height,**images)
		self._name = "Explosive Bullet"