source: nagslang/__main__.py@ 677:e56449284b21

Last change on this file since 677:e56449284b21 was 677:e56449284b21, checked in by Stefano Rivera <stefano@…>, 8 years ago

Set the icon

File size: 911 bytes
Line 
1import sys
2
3import pygame
4import pygame.locals as pgl
5
6from nagslang.options import parse_args
7from nagslang.constants import SCREEN
8from nagslang.engine import Engine
9from nagslang.sound import sound
10from nagslang.resources import Resources
11
12
13def main():
14 '''Launch the nagslang'''
15 parse_args(sys.argv)
16 pygame.display.init()
17 pygame.font.init()
18
19 # set_icon needs to be called before set_mode on some platforms, but we
20 # can't use convert_alpha until we've created a window with set_mode
21 r = Resources('data')
22 r.CONVERT_ALPHA = False
23 pygame.display.set_icon(r.get_image('werewolf-sonata_24.png',
24 basedir='icons'))
25
26 pygame.display.set_mode(SCREEN, pgl.SWSURFACE | pgl.RESIZABLE)
27 pygame.display.set_caption('Werewolf Sonata')
28 sound.init()
29
30 screen = pygame.display.get_surface()
31 engine = Engine(screen)
32 engine.run()
Note: See TracBrowser for help on using the repository browser.