Exemplo n.º 1
0
 def __init__(self):
     self.time = 0.0
     self.color = pygame.color.Color("black")
     self.selectedColor = pygame.color.Color("black")
     Globals.SCREEN.fill(pygame.color.Color("black"))
     self.selectionID = 0
     ImageManager.unloadAll()
     ImageManager.loadSet("Astoria")
     ImageManager.loadSet("debug")
     AudioManager.loadSfxSet("menu")
     AudioManager.loadSfxSet("game")
     if AudioManager.loadedMusic != "title" or\
             not pygame.mixer.music.get_busy():
         AudioManager.loadMusic("title")
         pygame.mixer.music.play(-1)
     Globals.LASTSCREENMAIN = True
     self.astoriaToggleTime = 0.0
     self.astoriaToggleTimeInterval = 2
     self.astoriaOpacity = 0
     temp = ImageManager.levelRes["Astoria"]["Astoria1.png"]
     temp2 = ImageManager.levelRes["Astoria"]["Astoria2.png"]
     width = 500
     height = 200
     ImageManager.levelRes["Astoria"]["Astoria1.png"] =\
         pygame.transform.scale(temp, (width, height))
     ImageManager.levelRes["Astoria"]["Astoria2.png"] =\
         pygame.transform.scale(temp2, (width, height))
Exemplo n.º 2
0
 def exitFinal(self):
     ImageManager.unloadSet("debug")
     AudioManager.unloadSfxSet("debug")
     World.cleanupCompletely()
     AudioManager.loadMusic("title")
     pygame.mixer.music.play(-1)
     if Globals.LEVELS_BEAT < 5:
         Globals.LEVELS_BEAT = 5
     Globals.SCORE = Globals.SCORE + 5000*Globals.MINI_SUNS
     Globals.PLAYER = None
     Globals.STATE = CompletedGameScreen.CompletedGameScreen()
     Globals.CHECKPOINT_SET = False
 def __init__(self):
     self.time = 0.0
     self.color = pygame.color.Color("white")
     Globals.SCREEN.fill(pygame.color.Color("black"))
     self.text = ""
     self.width, self.height = Globals.FONT.size(self.text)
     AudioManager.loadSfxSet("title")
     if AudioManager.loadedMusic != "title" or\
             not pygame.mixer.music.get_busy():
         AudioManager.loadMusic("title")
         pygame.mixer.music.play(-1)
     ImageManager.loadSet("cutscene")
     self.temp = ImageManager.levelRes["cutscene"]["CutSceneSnowboss.png"]
     ImageManager.levelRes["cutscene"]["CutSceneSnowboss.png"] =\
         pygame.transform.scale(self.temp, (800, 600))
Exemplo n.º 4
0
 def __init__(self):
     self.time = 0.0
     self.color = pygame.color.Color("black")
     Globals.SCREEN.fill(pygame.color.Color("black"))
     self.text = "Noel's Journey ... "
     self.width, self.height = Globals.FONT.size(self.text)
     AudioManager.loadSfxSet("title")
     if AudioManager.loadedMusic != "title" or\
             not pygame.mixer.music.get_busy():
         AudioManager.loadMusic("title")
         pygame.mixer.music.play(-1)
     ImageManager.loadSet("title")
     self.temp = ImageManager.levelRes["title"]["Title_Screen.png"]
     ImageManager.levelRes["title"]["Title_Screen.png"] =\
         pygame.transform.scale(self.temp, (1000, 600))
Exemplo n.º 5
0
    def __init__(self):
        ImageManager.loadSet("player")
        ImageManager.loadSet("effects")
        ImageManager.loadSet(Globals.CURRENT_LEVEL)

        if len(World.groups["HUD"].sprites()) == 0:
            healthHud = Entity.Entity()
            healthHud.componentList.append(CHUDHealth.CHUDHealth())
            World.groups["HUD"].add(healthHud)

            #manaHud = Entity.Entity()
            #manaHud.componentList.append(CHUDMana.CHUDMana())
            #World.groups["HUD"].add(manaHud)

            healthText = Entity.Entity()
            healthText.componentList.append(CHUDHealthText.CHUDHealthText())
            World.groups["HUDText"].add(healthText)

            #manaText = Entity.Entity()
            #manaText.componentList.append(CHUDManaText.CHUDManaText())
            #World.groups["HUDText"].add(manaText)

            scoreText = Entity.Entity()
            scoreText.componentList.append(CHUDScoreText.CHUDScoreText())
            World.groups["HUDText"].add(scoreText)

            sunText = Entity.Entity()
            sunText.componentList.append(CHUDSunText.CHUDSunText())
            World.groups["HUDText"].add(sunText)

            if Globals.CURRENT_LEVEL == "five":
                bossHUD = Entity.Entity()
                bossHUD.componentList.append(CHUDBoss.CHUDBoss())
                World.groups["HUD"].add(bossHUD)

        if Globals.PLAYER is None:
            World.loadMap(Globals.CURRENT_LEVEL)
            World.loadBG(Globals.CURRENT_LEVEL)
            World.initialize()

            entity = Entity.Entity()
            entity.componentList.append(CAnimation.CAnimation(
                ImageManager.levelRes["player"]["Noel_SpriteSheet.png"],
                6, 6, 0, 0.17))
            entity.componentList.append(CPhysics.CPhysics())
            entity.componentList.append(CBasicControl.CBasicControl())
            entity.componentList.append(CCollision.CCollision())
            entity.componentList.append(CView.CView())
            entity.componentList.append(
                CLiving.CLiving(Globals.PLAYER_MAX_HEALTH))
            entity.componentList.append(CDamage.CDamage(Globals.PLAYER_DAMAGE))
            entity.componentList.append(CPlayer.CPlayer())
            entity.componentList.append(CDeathParticle.CDeathParticle(
                ImageManager.levelRes["player"]["Noel_Dead.png"],
                3,
                (0, -20),
                0,
                pygame.BLEND_ADD))
            World.groups["player"].add(entity)
            entity.initialize()
            entity.state = 1
            Globals.PLAYER = entity
            Globals.WIN = False
            Globals.TIME = 120

            zord = Entity.Entity()
            zord.componentList.append(CAnimation.CAnimation(
                ImageManager.levelRes["player"]["Zord_Spritesheet.png"],
                6, 6, 0, 0))
            zord.componentList.append(CPhysics.CPhysics())
            zord.accy = 0
            zord.componentList.append(CAttach.CAttach(entity, 53))
            World.groups["equipment"].add(zord)
            zord.initialize()

            if not Globals.CHECKPOINT_SET or Globals.CURRENT_LEVEL == "five":
                Globals.PLAYER.posx = World.playerPos[0]
                Globals.PLAYER.posy = World.playerPos[1]
            else:
                Globals.PLAYER.posx = float(Globals.getCheckpointPos()[0])
                Globals.PLAYER.posy = float(Globals.getCheckpointPos()[1])

        self.timer = 1.0
        self.bossWinTimer = 4.0

        if AudioManager.loadedMusic != Globals.CURRENT_LEVEL or\
                not pygame.mixer.music.get_busy():
            AudioManager.loadMusic(Globals.CURRENT_LEVEL)
            if AudioManager.loadedMusic == Globals.CURRENT_LEVEL:
                pygame.mixer.music.play(-1)
                if Globals.CURRENT_LEVEL == "five":
                    pygame.mixer.music.set_volume(0.1)

        if not Globals.CURRENT_LEVEL == "five":
            self.sunArray = []
            for sun in Globals.SUN_TRACKER[Globals.CURRENT_LEVEL]:
                self.sunArray.append(sun)