コード例 #1
0
ファイル: gamemenu.py プロジェクト: centipeda/solarwolf
    def starting(self):
        snd.playmusic('aster2_sw.xm')

        gfx.dirty(gfx.surface.blit(self.logo, self.logorect))
        gfx.dirty(gfx.surface.blit(self.bigship, self.bigshiprect))

        self.fame = self.renderhall()
コード例 #2
0
    def starting(self):
        snd.playmusic('aster2_sw.xm')

        gfx.dirty(gfx.surface.blit(self.logo, self.logorect))
        gfx.dirty(gfx.surface.blit(self.bigship, self.bigshiprect))

        self.fame = self.renderhall()
コード例 #3
0
 def starting(self):
     if self.startmusic:
         self.startmusic = 0
         self.song = random.choice(Songs)
         snd.playmusic(*self.song)
         self.songtime = pygame.time.get_ticks()
     gfx.dirty(self.background(gfx.rect))
コード例 #4
0
ファイル: gameplay.py プロジェクト: centipeda/solarwolf
 def starting(self):
     if self.startmusic:
         self.startmusic = 0
         self.song = random.choice(Songs)
         snd.playmusic(*self.song)
         self.songtime = pygame.time.get_ticks()
     gfx.dirty(self.background(gfx.rect))
コード例 #5
0
 def starting(self):
     """
     Funcao de abertura do menu: Carrega a musica principal e
     desenha o logo do jogo.
     """
     snd.playmusic('aster2_sw.xm')
     gfx.dirty(gfx.surface.blit(self.logo, self.logorect))
コード例 #6
0
ファイル: gameplay.py プロジェクト: kevinmel2000/py1945game
 def starting(self):
     """
     Funcao de pre-inicializacao do jogo.
     """
     if self.startmusic:
         self.startmusic = 0
         self.song = random.choice(Songs)
         snd.playmusic(*self.song)
         self.songtime = pygame.time.get_ticks()
     gfx.dirty(self.background(gfx.rect))
コード例 #7
0
 def starting(self):
     """
     Funcao de pre-inicializacao do jogo.
     """
     if self.startmusic:
         self.startmusic = 0
         self.song = random.choice(Songs)
         snd.playmusic(*self.song)
         self.songtime = pygame.time.get_ticks()
     gfx.dirty(self.background(gfx.rect))
コード例 #8
0
    def levelstart_start(self):
        self.levelnum += 1

        self.numdeaths = 0

        levels.init('waves%d' % self.levelnum)
        self.waves = levels.maxwavesperlevel()

        if pygame.time.get_ticks() - self.songtime > game.musictime:
            songs = list(Songs)
            songs.remove(self.song)
            self.song = random.choice(songs)
            snd.playmusic(*self.song)
            self.songtime = pygame.time.get_ticks()

        if self.map: self.map.cleanup()
        self.map = map.TiledMap('map%d' % self.levelnum)
コード例 #9
0
ファイル: gameplay.py プロジェクト: kevinmel2000/py1945game
    def levelstart_start(self):
        self.levelnum += 1

        self.numdeaths = 0

        levels.init("waves%d" % self.levelnum)
        self.waves = levels.maxwavesperlevel()

        if pygame.time.get_ticks() - self.songtime > game.musictime:
            songs = list(Songs)
            songs.remove(self.song)
            self.song = random.choice(songs)
            snd.playmusic(*self.song)
            self.songtime = pygame.time.get_ticks()

        if self.map:
            self.map.cleanup()
        self.map = map.TiledMap("map%d" % self.levelnum)
コード例 #10
0
ファイル: gameplay.py プロジェクト: centipeda/solarwolf
    def levelstart_start(self):
        self.skipping = game.timeleft > 0.0
        self.levelnum += 1
        del self.boxobjs[:]
        self.newboxes, self.startpos, msg, num = levels.makelevel(self.levelnum)
        random.shuffle(self.newboxes)
        self.calcboxes = num
        self.addtime = 2
        if game.clock.get_fps() < 25:
            self.addtime = 1
        self.hud.drawlevel(self.levelnum)
        if game.comments >= 2:
            self.textobjs.append(objtext.Text(msg))
        self.grabbedboxes = 0
        self.numdeaths = 0
        for b in self.guardobjs:
            b.nofire()

        if self.levelnum > game.player.score:
            game.player.score = self.levelnum
        if not self.newcontinue and game.player.start_level() > self.startlevel:
            self.newcontinue = 1

        for i in range(levels.numrocks(self.levelnum) - len(self.asteroidobjs)):
            self.asteroidobjs.append(objasteroid.Asteroid())

        for p in self.powerupobjs:
            p.extendtime()

        if self.skipping:
            self.skiptime = 20

        # teleport in dead guards
        for g in self.guardobjs:
            if g.killed == 1:
                self.smokeobjs.append(objguard.TeleGuard(g))
                g.killed = 2

        # make spikes
        if self.levelnum >= 30:
            numspikes = min(int((self.levelnum - 30) / 5) + 1, len(self.newboxes) - 5)
            self.secretspikes = self.newboxes[-numspikes:]
        elif self.levelnum >= 10:
            numspikes = int((self.levelnum - 10) / 7) + 1
            spikes = self.newboxes[-numspikes:]
            self.newboxes = self.newboxes[:-numspikes]
            for b in spikes:
                s = objbox.Spike(b.rect.topleft)
                self.spikeobjs.append(s)
            self.secretspikes = []
            self.touchingsecretspike = None
        else:
            self.secretspikes = []
            self.touchingsecretspike = None

        # rotate music
        if pygame.time.get_ticks() - self.songtime > game.musictime:
            songs = list(Songs)
            songs.remove(self.song)
            self.song = random.choice(songs)
            snd.playmusic(*self.song)
            self.songtime = pygame.time.get_ticks()
コード例 #11
0
    def levelstart_start(self):
        self.skipping = game.timeleft > 0.0
        self.levelnum += 1
        del self.boxobjs[:]
        self.newboxes, self.startpos, msg, num = levels.makelevel(
            self.levelnum)
        random.shuffle(self.newboxes)
        self.calcboxes = num
        self.addtime = 2
        if game.clock.get_fps() < 25:
            self.addtime = 1
        self.hud.drawlevel(self.levelnum)
        if game.comments >= 2:
            self.textobjs.append(objtext.Text(msg))
        self.grabbedboxes = 0
        self.numdeaths = 0
        for b in self.guardobjs:
            b.nofire()

        if self.levelnum > game.player.score:
            game.player.score = self.levelnum
        if not self.newcontinue and game.player.start_level(
        ) > self.startlevel:
            self.newcontinue = 1

        for i in range(
                levels.numrocks(self.levelnum) - len(self.asteroidobjs)):
            self.asteroidobjs.append(objasteroid.Asteroid())

        for p in self.powerupobjs:
            p.extendtime()

        if self.skipping: self.skiptime = 20

        #teleport in dead guards
        for g in self.guardobjs:
            if g.killed == 1:
                self.smokeobjs.append(objguard.TeleGuard(g))
                g.killed = 2

        #make spikes
        if self.levelnum >= 30:
            numspikes = min(
                int((self.levelnum - 30) // 5) + 1,
                len(self.newboxes) - 5)
            self.secretspikes = self.newboxes[-numspikes:]
        elif self.levelnum >= 10:
            numspikes = int((self.levelnum - 10) // 7) + 1
            spikes = self.newboxes[-numspikes:]
            self.newboxes = self.newboxes[:-numspikes]
            for b in spikes:
                s = objbox.Spike(b.rect.topleft)
                self.spikeobjs.append(s)
            self.secretspikes = []
            self.touchingsecretspike = None
        else:
            self.secretspikes = []
            self.touchingsecretspike = None

        #rotate music
        if pygame.time.get_ticks() - self.songtime > game.musictime:
            songs = list(Songs)
            songs.remove(self.song)
            self.song = random.choice(songs)
            snd.playmusic(*self.song)
            self.songtime = pygame.time.get_ticks()