X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2F__main__.py;h=02f49a3e7c8c2298537f06347dc9b6dcdced6f91;hb=c7c0aeb2347992dfb69844700711bd0ded2caf0c;hp=a4f4aa3204b90ca06b21cfe7af6aca09f4a13ae1;hpb=39f49f9579bdee2ad449246d1370a0be27186ed9;p=naja.git diff --git a/naja/__main__.py b/naja/__main__.py index a4f4aa3..02f49a3 100644 --- a/naja/__main__.py +++ b/naja/__main__.py @@ -1,14 +1,41 @@ import sys import pygame +import pygame.locals as pgl +from naja.constants import SCREEN +from naja.engine import Engine +from naja.sound import sound from naja.options import parse_args +from naja.resources.loader import Loader +from naja.scenes.menu import MenuScene def main(): - '''Launch the nagslang''' + '''Launch the naja''' parse_args(sys.argv) pygame.display.init() pygame.font.init() - raise NotImplementedError("Sorry, we haven't written a game yet.") + # set_icon needs to be called before set_mode on some platforms, but we + # can't use convert_alpha until we've created a window with set_mode + r = Loader('data') + r.CONVERT_ALPHA = False + icon_filename = 'robot_24.png' + # OSX accepts big icons, but scales up small icons smoothly + if sys.platform == 'darwin': + icon_filename = 'robot_512.png' + pygame.display.set_icon(r.get_image(icon_filename, basedir='icons')) + + pygame.display.set_mode(SCREEN, pgl.SWSURFACE) + pygame.display.set_caption('Robolock II') + sound.init() + + screen = pygame.display.get_surface() + scene = MenuScene(None) + engine = Engine(screen, scene, None) + engine.run() + + +if __name__ == '__main__': + main()