File: gamefinish.py

package info (click to toggle)
solarwolf 1.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,348 kB
  • ctags: 371
  • sloc: python: 2,640; makefile: 56; sh: 31
file content (39 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"gamefinish handler. just lets our stars trickle"

import pygame
import gfx, game, snd



class GameFinish:
    def __init__(self, prevhandler):
        self.prevhandler = prevhandler
        self.ticks = 17
        self.started = 0

    def input(self, i):
        pass

    def event(self, e):
        pass

    def run(self):
        gfx.updatestars(self.background, gfx)
        self.ticks -= 1
        if not self.started:
            self.started = 1
            if snd.music:
                snd.music.fadeout(15*game.clock.fps_ticks)

        if not self.ticks:
            gfx.surface.fill(0)
            pygame.display.update()
            #pygame.time.delay(200)
            game.handler = self.prevhandler


    def background(self, area):
        return gfx.surface.fill((0, 0, 0), area)