예제 #1
0
파일: projectile.py 프로젝트: molock/game
	def __init__(self, rectPos, bodyPos, orientation, friendlyFire, seconds, identifier, collisionType):
		pygame.sprite.Sprite.__init__(self)
		Physical.__init__(self, bodyPos, orientation, velocity=70, 
								mass=10, elasticity=0.9, shape={"circle": 10}, 
								maxVel=200, collisionType=collisionType)
		self.identifier = identifier
		imgPath = os.path.dirname(os.path.dirname( os.path.realpath( __file__ ) ) ) + "/images/arrow.png"
		self.image = pygame.image.load(imgPath)
		self.rect = self.image.get_rect()	
		self.rect.center = rectPos
		self.lastPos = bodyPos
		self.distTraveled = 0
		self.friendlyFire = friendlyFire
		self.seconds = seconds
		#self.rotate(orientation)
		self.applyImpulse()
예제 #2
0
파일: entity.py 프로젝트: mulaifi/game
	def __init__(self, recPos, worldPos, resolution, collisionType):
		pygame.sprite.Sprite.__init__(self)
		Physical.__init__(self, worldPos, orientation=0, velocity=50, mass=10,
							elasticity=0.65, shape={"circle": 20}, maxVel=200, 
							angularVel=0.087, collisionType = collisionType)

		imgPath = os.path.dirname(os.path.dirname( os.path.realpath( __file__ ) ) ) + "/images/ship.gif"
		self.origImg = pygame.image.load(imgPath)
		self.image = pygame.image.load(imgPath)
		self.rect = self.image.get_rect()
		self.rect.center = recPos
		self.resolution = resolution
		self.direction= Vec2d(0,0) 
		self.observers = []
		self.coolDowns = [False]
		self.alive = True
		self.hp = 100
예제 #3
0
 def __init__(self, rectPos, bodyPos, orientation, friendlyFire, seconds,
              identifier, collisionType):
     pygame.sprite.Sprite.__init__(self)
     Physical.__init__(self,
                       bodyPos,
                       orientation,
                       velocity=70,
                       mass=10,
                       elasticity=0.9,
                       shape={"circle": 10},
                       maxVel=200,
                       collisionType=collisionType)
     self.identifier = identifier
     imgPath = os.path.dirname(os.path.dirname(
         os.path.realpath(__file__))) + "/images/arrow.png"
     self.image = pygame.image.load(imgPath)
     self.rect = self.image.get_rect()
     self.rect.center = rectPos
     self.lastPos = bodyPos
     self.distTraveled = 0
     self.friendlyFire = friendlyFire
     self.seconds = seconds
     #self.rotate(orientation)
     self.applyImpulse()
예제 #4
0
파일: food.py 프로젝트: Aquarius314/Ecosim
 def __init__(self, x, y):
     Physical.__init__(self, x, y, 0)
     return
예제 #5
0
파일: ball.py 프로젝트: ippo615/experiments
	def __init__( self, x, y ):
		Point2D.__init__( self, x, y )
		Physical.__init__( self )
		Drawable.__init__( self )
예제 #6
0
 def __init__(self, x, y, r):
     Physical.__init__(self, x, y, r)
     return