def setCanvasPlay(self): lavaSize = 70 self.setBackground() lavaPos=0 while lavaPos < self.width: self.ecran.blit(pygame.image.load(image.getImagePath()+"lava.png").convert_alpha(), (lavaPos, self.height - lavaSize)) lavaPos += lavaSize
def __init__(self, name, ecran, posX, posY, nbStepMax=4): super().__init__(name, ecran, nbStepMax) self.direction = 'right' self.imageDir = image.getImagePath() + "ennemy/" + name + "/" self.posX = posX self.posY = posY self.moveSpeed = 2 self.width = 70 self.height = 72 self.ecran.blit(self.getImage(), (self.posX, self.posY))
def __init__(self, name, ecran, nbStepMax=4): self.moveSpeed = 4 self.fallSpeed = 5 self.imageDir = image.getImagePath() + name + "/" self.name = name self.image = None self.posX = 0 self.posY = 60 self.width = 105 self.height = 160 self.step = 0 self.timerSwitchMoveImage = 0 self.direction = '' self.ecran = ecran self.action = 'walk' self.type = "" self.nbStepMax = nbStepMax
def getImage(self): if self.image == None: self.image = pygame.image.load(image.getImagePath() + "Environment/" + self.name + ".png").convert_alpha() return self.image
def setGameOverScreen(self): self.setBackground() imageGameOver= pygame.image.load(image.getImagePath()+"gameOver.png").convert_alpha() self.ecran.blit(imageGameOver, ((self.width/2)-99, (self.height/2)-127)) pygame.display.flip()
def _GetBackGroundImage(cls): return pygame.image.load(image.getImagePath()+"background.png").convert_alpha()
def setContinuText(self): imageContinu = pygame.image.load(image.getImagePath()+"continu.png").convert_alpha() self.ecran.blit(imageContinu, ((self.width/2)-400, (self.height/2)-50)) pygame.display.flip()