Esempio n. 1
0
 def __init__(self, screen, pos, patrolRadius, golemType, life):
     self.screen = screen
     self.life = life
     self.golemType = golemType
     self.name = ''
     self.renameTheGolemType()
     self.patrolRadius = patrolRadius
     self.state = 'Idle'
     self.move_direction = 'right'
     self.imgGolens = pygame.image.load(
         "resources/image/enimy/golens/Golem_" + str(self.golemType) + "/" +
         self.state + "/" + self.move_direction + "/0_Golem_" + self.state +
         "_0.png").convert_alpha()
     self.rect = self.imgGolens.get_rect()
     self.rect.x = pos[0]
     self.rect.y = pos[1]
     self.initialPosition = pos[0]
     self.ai = EnimysAI(self.patrolRadius, 50, self.rect.x)
     self.collision = Colision()
     self.move_right = False
     self.move_left = False
     self.air_timer = 0
     self.vertical_momentum = 0
     self.move_frame = 0
     self.attacking = False
     self.isMe = False
Esempio n. 2
0
 def __init__(self, screen, nivel):
     self.screen = screen
     self.nivel = nivel
     self.position = []
     self.determinatePositionOfLifItems()
     self.collision = Colision()
     self.item = [PlantLife(self.screen) for i in range(len(self.position))]
     self.item_rects = pygame.Rect(0, 0, 0, 0)
Esempio n. 3
0
 def __init__(self, screen, position):
     self.screen = screen
     self.name = 'cactus'
     self.collision = Colision()
     self.air_timer = 0
     self.vertical_momentum = 0
     self.img = pygame.image.load(
         "resources/image/platform/florest/obstaculo/cactus.png"
     ).convert_alpha()
     self.cactusRects = self.img.get_rect()
     self.cactusRects.x = position[0]
     self.cactusRects.y = position[1]
Esempio n. 4
0
 def __init__(self, screen, fireType, pos, direction):
     self.screen = screen
     self.collision = Colision()
     self.img = [pygame.image.load("resources/image/Golem/fire/"+direction+"/"+fireType+""+str(i)+".png") for i in range(2)]
     self.rect = self.img[0].get_rect()
     self.player_pos = pos
     self.nrimg = 0
     if(direction == "right"):
         self.rect.x = pos[0]+40
     else:
         self.rect.x = pos[0]-40
     self.rect.y = pos[1] + 15
     self.direction = direction
Esempio n. 5
0
 def __init__(self, screen, nivel, enimysKilled):
     self.screen = screen
     self.nivel = nivel
     self.enimyskilled = enimysKilled
     self.collision = Colision()
     self.allEnimys = []
     self.allEnimysPosition = []
     self.allCactus = []
     self.allCactusPosition = []
     self.enimyKilled = 0
     self.bossKilled = False
     self.count = 0
     self.addingAllTheAnimys()
Esempio n. 6
0
 def __init__(self, screen, pos, patrolRadius, life):
     self.screen = screen
     self.life = life
     self.name = 'blue wizard'
     self.patrolRadius = patrolRadius
     self.rect = pygame.Rect(40, 30, 20, 42)
     self.rect.x = pos[0]
     self.rect.y = pos[1]
     self.initialPosition = pos[0]
     self.ai = EnimysAI(self.patrolRadius,200, self.rect.x)
     self.collision = Colision()
     self.state = 'idle'
     self.move_direction = 'right'
     self.move_right = False
     self.move_left = False
     self.air_timer = 0
     self.vertical_momentum = 0
     self.img = pygame.image.load("resources/image/enimy/wizard/"+self.state+"/"+self.move_direction+"/Chara-0.png")
     self.move_frame = 0
     self.impactDelay = 0
     self.attacking = False
     self.isMe = False
Esempio n. 7
0
    def __init__(self, screen, nivel, lastPassPoint):
        self.collision = Colision()
        self.screen = screen
        self.air_timer = 0
        self.vertical_momentum = 0
        self.player_move = [0, 0]
        self.move_direction = 'right'
        self.state = 'Idle'
        self.skillsInUse = 'kicking'
        self.move_frame = 0
        self.player_img = pygame.image.load("resources/image/Golem/"+self.state+"/"+self.move_direction+"/0_Goblin_"+self.state+"_0.png").convert_alpha()
        self.player_rect=self.player_img.get_rect()
        self.player_rect.x = lastPassPoint[0]
        self.player_rect.y = lastPassPoint[1]
        ## atributes to control the player state
        self.moving_right = False
        self.moving_left = False
        self.jumping = False
        self.hurtten = False
        self.attack = False
        self.bottomColision = False
        self.topColision = False
        self.firing = False
        self.preCollisionAriaRight = [0,0]
        self.preCollisionAriaLeft = [0,0]
     

        self.vertical_momentum = 0
        self.air_timer = 0
        self.player_screen_limit = 380
        self.nivel = nivel
        self.impactDelay = 0
        self.slashingControl = 0
        self.count = 0
        self.fireArray = []
        self.enimyCollision = False
        self.enimyType = ''         
Esempio n. 8
0
 def __init__(self, screen, pos, patrolRadius, life):
     self.screen = screen
     self.life = life
     self.name = 'minotauro'
     self.patrolRadius = patrolRadius
     self.state = 'Idle'
     self.move_direction = 'right'  #resources\image\enimy\minotauro\Minotauro_1\Idle\right\Minotaur_Idle_0.png
     self.imgMinotaur = pygame.image.load(
         "resources/image/enimy/minotauro/" + self.state + "/" +
         self.move_direction + "/Minotaur_" + self.state +
         "_0.png").convert_alpha()
     self.rect = self.imgMinotaur.get_rect()
     self.rect.x = pos[0]
     self.rect.y = pos[1]
     self.initialPosition = pos[0]
     self.ai = EnimysAI(self.patrolRadius, 100, self.rect.x)
     self.collision = Colision()
     self.move_right = False
     self.move_left = False
     self.air_timer = 0
     self.vertical_momentum = 0
     self.move_frame = 0
     self.attacking = False
     self.isMe = False