/usr/lib/games/solarwolf/gamecreds.py is in solarwolf 1.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | "gamemenu handler. main menu"
import math, os
import pygame
from pygame.locals import *
import game, gfx, snd, txt
import gameplay
credits = (
('Developer', ('Pete "ShredWheat" Shinners',)),
('Graphics', ('Eero Tamminen',)),
('Music', ('"theGREENzebra"',)),
('Programming Help', ('Aaron "APS" Schlaegel', 'Michael "MU" Urman')),
('Special Thanks', ('David "Futility" Clark', 'Shandy Brown', 'John "Jacius" Croisant', 'Guido "Python" van Rossom', 'Sam "SDL" Lantinga')),
)
licenseinfo = ('This program is free software. You are encouraged to',
'make copies and modify it, subject to the LGPL.',
'See "lgpl.txt" file for details.')
fonts = []
images = []
def load_game_resources():
global fonts, images
fontname = None
fonts.append((txt.Font(fontname, 30), (50, 120, 100)))
fonts.append((txt.Font(fontname, 44), (100, 100, 250)))
img = gfx.load('oldsolarfox.png')
r = img.get_rect()
r.bottomright = gfx.rect.bottomright
images.append((img, r))
img = gfx.load('pygame_powered.gif')
r = img.get_rect().move(540, 20)
images.append((img, r))
img = gfx.load('sdlpowered.png')
r = img.get_rect().move(630, 150)
images.append((img, r))
img = gfx.load('pythonpowered.gif')
r = img.get_rect().move(650, 280)
images.append((img, r))
img = gfx.load('menu_creds_on.png')
r = img.get_rect().move(20, 5)
images.append((img, r))
font = txt.Font(None, 15)
top = 560
mid = 400
for l in licenseinfo:
t = font.text((50, 150, 150), l, (mid, top))
top += t[1].height
images.append(t)
snd.preload('select_choose')
class GameCreds:
def __init__(self, prevhandler):
self.prevhandler = prevhandler
self.done = 0
self.center = gfx.rect.centerx - 120
self.text = []
self.credits = []
self.area = Rect(40, 140, 500, 400)
self.offset = 0
for cred in credits:
self.createtext(cred[0], 0)
for peop in cred[1]:
self.createtext(peop, 1)
self.offset += 30
self.offset = 0.0
self.oldoffsety = 0.0
self.text.extend(images)
self.first = 1
self.fade = ((1, 4), (8, 3), (15, 2), (21, 1))
self.darkpic = pygame.Surface(self.area.size)
self.darkpic.set_alpha(3)
def createtext(self, text, size):
f, c = fonts[size]
t = f.textlined(c, text, (self.center, 0))
t[1].top = self.offset
self.offset = t[1].bottom - 5
self.credits.append(t)
def quit(self):
gfx.dirty(self.background(gfx.rect))
game.handler = self.prevhandler
self.done = 1
snd.play('select_choose')
def input(self, i):
self.quit()
def event(self, e):
pass
def run(self):
if self.first:
gfx.dirty(gfx.rect)
self.first = 0
ratio = game.clockticks / 25
speedadjust = max(ratio, 1.0)
self.offset += speedadjust * 1.0
offsety = self.area.bottom-self.offset
oldclip = gfx.surface.get_clip()
gfx.surface.blit(self.darkpic, self.area)
gfx.updatestars(self.background, gfx)
item = 0.0
if not self.done:
for cred, pos in self.text:
gfx.surface.blit(cred, pos)
gfx.surface.set_clip(self.area)
for cred, pos in self.credits:
offsetx = math.cos(self.offset * .04 + item)*30.0
item -= 0.25
r = pos.move(offsetx, offsety)
bottom = r.bottom
gfx.surface.blit(cred, r)
#gfx.dirty(gfx.surface.blit(cred, r))
gfx.surface.set_clip(oldclip)
gfx.dirty(self.area)
for y,h in self.fade:
r = Rect(self.area.left, self.area.top+y, self.area.width, h)
self.background(r)
r = Rect(self.area.left, self.area.bottom-y-h, self.area.width, h)
self.background(r)
if bottom < self.area.top:
self.offset = 0.0
else:
for text in self.text:
r = text[1]
gfx.dirty(self.background(text[1]))
def background(self, area):
return gfx.surface.fill((0, 0, 0), area)
|