Esempio n. 1
0
	def __init__( self, image=None,
				location=geometry.Vector( 0, 0 ),
				velocity=geometry.Vector( 0, 0 ) ):
		Entity.__init__( self, location, velocity )

		if isinstance( image, pygame.Surface ):
			self.image = image
		else:
			self.image = misc.load_image( image )

		if image is not None:
			self.rect = self.image.get_rect()
Esempio n. 2
0
    def __init__(self,
                 image=None,
                 location=geometry.Vector(0, 0),
                 velocity=geometry.Vector(0, 0)):
        Entity.__init__(self, location, velocity)

        if isinstance(image, pygame.Surface):
            self.image = image
        else:
            self.image = misc.load_image(image)

        if image is not None:
            self.rect = self.image.get_rect()
Esempio n. 3
0
	def __init__( self, image=None,
				location=geometry.Vector( 0, 0 ),
				velocity=geometry.Vector( 0, 0 ) ):

		pygame.sprite.Sprite.__init__( self )

		if isinstance( image, pygame.Surface ):
			self.image = image
		else:
			self.image = misc.load_image( image )

		if isinstance( location, geometry.Vector ):
			self.location = location
		else:
			self.location = geometry.Vector( location[0], location[-1] )

		if isinstance( velocity, geometry.Vector ):
			self.velocity = velocity
		else:
			self.velocity = geometry.Vector( velocity[0], velocity[-1] )

		if image is not None:
			self.rect = self.image.get_rect()
		self.boundingPoly = geometry.Rect( self.rect.x, self.rect.y, self.get_width(), self.get_height() )
Esempio n. 4
0
	def set_background( self, background ):
		self.background = misc.load_image( background )