コード例 #1
0
ファイル: player.py プロジェクト: CannonFodder/cannonfodder
    def render(self, surface, renderRect):
        
        GameEntity.render( self, surface, self.rect )
        ## Draw crosshair ##
        
        # circle 
        pygame.draw.circle( surface, (255,0,0), self.crosshairPos, 8, 1 )

        # top - > down 
        startpos = ( self.crosshairPos[0], self.crosshairPos[1] - 5 )
        endpos   = ( self.crosshairPos[0], self.crosshairPos[1] + 5 )
        pygame.draw.line( surface, (255,255,255), startpos, endpos, 1 )
        
        # left -> right
        startpos = (self.crosshairPos[0] - 5, self.crosshairPos[1] )
        endpos   = (self.crosshairPos[0] + 5, self.crosshairPos[1] )
        pygame.draw.line( surface, (255,255,255), startpos, endpos, 1 )
        
        
コード例 #2
0
 def __init__(self, name, pos, animationSpeed):
     GameEntity.__init__(self, position=pos, name=name )
     self.animationSpeed = animationSpeed
     self.currentMode    = 'a'
     self.activeDirectionIndex = 0
コード例 #3
0
ファイル: player.py プロジェクト: CannonFodder/cannonfodder
 def update(self, timePassed):
     GameEntity.update( self, timePassed )
     self.refToGameWorld.setViewport( self.position )
コード例 #4
0
ファイル: player.py プロジェクト: CannonFodder/cannonfodder
 def __init__(self, playerId, isAiPlayer = False):
     GameEntity.__init__(self)
     self.playerId   = playerId 
     self.isAiPlayer = isAiPlayer
     self.position   = Vector2D(10.0,10.0)
     self.checkVisibility = False