font = None
colour = None
height = 0
+ debug = False
def __init__(self, font, height, colour, debug=False):
self.font = pygame.font.Font(font, height)
self.height = height
self.colour = colour
- self.debug = debug
- if self.debug: engine.debug_pr("Style %s, height: %d, colour:" % (font, height), self.colour)
+ Style.debug = debug
+ if Style.debug: engine.debug_pr("Style %s, height: %d, colour:" % (font, height), self.colour)
class Game:
""" Container for all game state and configuration items """
# splash screen
self.splash()
- def print(self, text, style):
+ def print(self, text, style='body'):
""" print a line of text and move the text origin to the next line """
if not style in self.styles:
style = 'body'
# print the Game title and copyright
self.print_x, self.print_y = 40, 40 # indent
self.print(self.resources['title'], 'h1')
- self.print(self.resources['copyright'], 'body')
+ self.print(self.resources['copyright'])
# print the Soundtrack copyright information
- self.print('Soundtrack:', 'body')
+ self.print('Soundtrack:',)
self.print_x += 20 # indent
for key in ('copyright', 'license', 'url'):
- text = "%s: %s" % (key, self.resources["soundtrack.%s" % key])
- self.print(text, 'body')
+ text = "%12s: %s" % (key, self.resources["soundtrack.%s" % key])
+ self.print(text)
pygame.display.update()