当前位置: 首页>>代码示例>>Python>>正文


Python Entity.Entity类代码示例

本文整理汇总了Python中Entity.Entity的典型用法代码示例。如果您正苦于以下问题:Python Entity类的具体用法?Python Entity怎么用?Python Entity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Entity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, x, y):
     Entity.__init__(self)
     self.image = pygame.image.load("files/Platforms/Bad_Platform.png")
     self.image = pygame.transform.scale(self.image, (128, 32))
     self.image.convert()
    
     self.rect = Rect(x, y+10, 128, 32)  #Платформата се извежда "вкопана"
开发者ID:Plamen1466,项目名称:Robopartans_The_Game,代码行数:7,代码来源:BadPlatform.py

示例2: update

	def update(self,t=0):
		Entity.update(self,t)
		#print t, self.rect.topleft, self._speed 
		if self.jumping:
			# if the jumping flag is true,
			# call the jump function
			self.setSpeed('x',-14.0)
			self.jumping = False
		else:
			self.setSpeed('x',self._speed[1]+t/50.0)	
			if self.rect.top >= 230: # if you hit the top, reset the vel so it
				self.setSpeed('x',0.0) # doesn't get stuck up at the top

		# limit duration of post damage invincibility (2500 ms)
		if self._invincible_time > 0:
			self._invincible_time -= t
			
			# On average, turn invisible for every other frame
			if ((self._invincible_time /100)%2) == 0:
				self.image = self._invisible_pic
			else:
				self.image = self._images[0]
		
		if self.rect.left < 0:
			self.rect.left = 0
		elif self.rect.right > 930:
			self.rect.right = 930
开发者ID:rokthewok,项目名称:ECE2524-Final-Project,代码行数:27,代码来源:player.py

示例3: __init__

	def __init__(self, x, y, image_path):
		Entity.__init__(self)
		self.image = pygame.image.load(image_path+"/ground.png")
		self.image = pygame.transform.scale(self.image, (64*6, 64))
		self.image.convert()

		self.rect = Rect(x, y, 64*6, 64)
开发者ID:Plamen1466,项目名称:Robopartans_The_Game,代码行数:7,代码来源:Ground.py

示例4: __init__

 def __init__(self, x, y, image_path):
     Entity.__init__(self)
     self.image = pygame.image.load(image_path+"/plate.png")
     self.image = pygame.transform.scale(self.image, (32, 32))
     self.image.convert()
    
     self.rect = Rect(x, y, 32, 32)
开发者ID:Plamen1466,项目名称:Robopartans_The_Game,代码行数:7,代码来源:ScoreLine.py

示例5: __init__

 def __init__(self):
   Entity.__init__(self)
   self.lastfm = pylast.LastFMNetwork(api_key=params.LASTFM_API_KEY,
                   api_secret=params.LASTFM_API_SECRET,
                   username=USERNAME,
                   password_hash=pylast.md5(PASSWORD))
   config.ECHO_NEST_API_KEY = params.ECHONEST_API_KEY
开发者ID:Sushant,项目名称:quest,代码行数:7,代码来源:Artist.py

示例6: entity_data

def entity_data(request):
    """ """
    site = request.matchdict['code']
    claims, site = verify_access(request, site=site)
    e = Entity(request)
    summnote, fullnote = e.data()
    return { 'summnote': summnote, 'fullnote': fullnote }
开发者ID:MLR-au,项目名称:esrc-cnex,代码行数:7,代码来源:views.py

示例7: __init__

    def __init__(self, x, y, imageName=None, colorkey=None, coordsName=None, numImages=None, magicNumbers=(0, 0, 0, 0, 0, 0, 0, 0), director=None, *args):
        Entity.__init__(self, x, y, imageName, colorkey, coordsName, numImages)
        self.director = None
        self.speedX = 0
        self.speedY = 0
        self.controller = None
        self.equippedWpn = None
        self.attacking = False
        self.atk_delay_reset = 1.0 # Character dependent delay time
        self.atk_delay = self.atk_delay_reset  # Starts with cooldown. Trust me, it's better.
        self.hp = 40
        self.atk = 10

        # To what point is the character trying to attack? Useful for ranged
        # weapons.
        self.atkX = 0
        self.atkY = 0

        self.just_attacked = False

        if not imageName:
            self.rect = pygame.Rect(x, y, 15, 25)

        # Needed for a better weapon placement
        self.magicNumbers = magicNumbers
        self.atk_speed = PLAYER_ATTACK_SPEED
开发者ID:hmourit,项目名称:Aleph,代码行数:26,代码来源:Character.py

示例8: update

 def update(*args):
     self = args[0]
     width = args[1]
     height = args[2]
     Entity.update(self, width, height)
     self.animate()
     self.changed = False
开发者ID:KRHS-GameProgramming-2014,项目名称:Shamwow,代码行数:7,代码来源:PowerDownPotato.py

示例9: __init__

 def __init__(self):
     Entity.__init__(self)
     self.type = 0
     self.rage = False
     self.health = 1
     self.dead = False
     self.facingRight = True
开发者ID:CHAZICLE,项目名称:supercram,代码行数:7,代码来源:Enemy.py

示例10: __init__

    def __init__(self, a):
        Entity.__init__(self, a)
        self.name = 'MouseEntity'
        self.mouse_pos = Vect2([0.0, 0.0])
        self.origImage = pygame.image.load('data/mousePlayer.png')
        self.image =  self.origImage
        self.imgState = 0
        self.image1 = pygame.image.load('data/mousePlayer_1.png')
        self.image2 = pygame.image.load('data/mousePlayer_2.png')
        self.image3 = pygame.image.load('data/mousePlayer_3.png')
        self.grabsound = pygame.mixer.Sound('data/grab.wav')
        self.dropsound = pygame.mixer.Sound('data/drop.wav')

        self.image = self.origImage
        self.radius = self.image.get_rect().width/2
        print self.radius
        self.rotate = 0

        self.radius = float(self.image.get_width()) / 2.0

        self.maxSpeed = 100
        
        self.grabbing = False
        self.grabDist = 60 # pixel distance within which you can grab something
        self.grabbedEntity = None
开发者ID:bpeck,项目名称:ProjectFuschiaFairy,代码行数:25,代码来源:MouseEntity.py

示例11: update

	def update(self,t=0):
		Entity.update(self,t)
		#print t, self.rect.topleft, self._speed 
		if self.jumping:
			# if the jumping flag is true,
			# call the jump function
			self.setSpeed('x',-14.0)
			self.jumping = False
		else:
			self.can_jump = True
			self.setSpeed('x',self._speed[1]+t/50.0)	
			if self.rect.top >= 230:
				self.setSpeed('x',0.0)

		# limit duration of post damage invincibility (2500 ms)
		if self._invincible == True:
			if self._invincible_time < 2500:
				self._invincible_time += t
				if ((self._invincible_time /100)%2) == 0:
					self.image = self._invisible_pic
				else:
					self.image = self._images[0]
			else:
				self._invincible = False
				self._invincible_time = 0
开发者ID:cabotzj,项目名称:ECE2524-Final-Project,代码行数:25,代码来源:player.py

示例12: __init__

 def __init__(self, id, name, numberOfUnits=1, parentBatch=None, parentBatchName=None, parentBatchId=None,
              remainingProcessingTime=0, currentStation=None, unitsToProcess=0,receiver=None,**kw):
     Entity.__init__(self, name=name, id=id, remainingProcessingTime=remainingProcessingTime,
                     currentStation=currentStation)
     self.numberOfUnits=int(numberOfUnits)
     self.parentBatch=parentBatch
     self.unitsToProcess=int(float(unitsToProcess))
     # if the parent batch was not given find it or create it
     if not self.parentBatch:
         # check if the parent batch is already created. If not, then create it
         batch=None
         from Batch import Batch
         from Globals import G
         for b in G.EntityList:
             if b.id==parentBatchId:
                 batch=b
         if batch:               #if the parent batch was found add the number of units of current sub-batch
             batch.numberOfUnits+=self.numberOfUnits
         else:     #if the parent batch was not found create it
             batch=Batch(parentBatchId,parentBatchName,numberOfUnits)
             G.EntityList.append(batch)
         self.parentBatch=batch
     self.batchId=self.parentBatch.id
     import Globals
     self.receiver=Globals.findObjectById(receiver)
     self.parentBatch.subBatchList.append(self)
开发者ID:Kodextor,项目名称:dream,代码行数:26,代码来源:SubBatch.py

示例13: _Render

    def _Render(self, renderWindow, windowView):
        """Here we render the contained entities onto the screen. (This happens once per program loop!)"""

        Entity._Render(self, renderWindow, windowView)

        for indx in xrange(len(self._pqEntities)):
            self._pqEntities[indx]._Render(renderWindow, windowView)
开发者ID:WaffleTime,项目名称:TileGame,代码行数:7,代码来源:Entity_PQueue.py

示例14: __init__

 def __init__(self, id):
     """
     Arguments:
     o id - int
     """
     self.level="M"
     Entity.__init__(self, id)
开发者ID:GunioRobot,项目名称:biopython,代码行数:7,代码来源:Model.py

示例15: __init__

    def __init__(self, id=None, name=None):
        Entity.__init__(self,id=id,name = name)

        self.Res=Resource(self.capacity)
        #dimension data
        self.width=2.0
        self.height=2.0
        self.lenght=2.0        
开发者ID:mmariani,项目名称:dream,代码行数:8,代码来源:Frame.py


注:本文中的Entity.Entity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。