Mercurial > zrpn
changeset 77:4352dc6691e9
moved initialisation code into main
| author | Rene Dudfield <renesd@gmail.com> |
|---|---|
| date | Sun, 08 Jul 2012 11:57:13 +0200 |
| parents | f78833197559 |
| children | 74ae038b52c4 |
| files | zrpn/main.py |
| diffstat | 1 files changed, 12 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/zrpn/main.py Sun Jul 08 11:48:46 2012 +0200 +++ b/zrpn/main.py Sun Jul 08 11:57:13 2012 +0200 @@ -13,7 +13,6 @@ import logging -screen = display.Display() class Game(object): @@ -43,26 +42,29 @@ def single(self): self.remove() - Game(screen).run() + Game(self.screen).run() def multi(self): import pygame_network as net net.event.init() - logging.basicConfig(level=logging.DEBUG) - ip = menu["ip"].text + ip = self["ip"].text ip = str(ip) client.Client(ip, 10000).run() -default_host = "zrpn.pygame.org" -default_host = "localhost" -menu = MainMenu(menu=("m:Zombies Robots Pirates Ninjas", ("f:single", "Single Player"), - ("w:input_box", "name=ip", "text={}".format(default_host), - "label=Enter IP for multiplayer server(eg. localhost)"), - ("f:multi", "Multiplayer"), ("f:exit", "Quit"))) def main(): + screen = display.Display() + + + default_host = "zrpn.pygame.org" + default_host = "localhost" + menu = MainMenu(menu=("m:Zombies Robots Pirates Ninjas", ("f:single", "Single Player"), + ("w:input_box", "name=ip", "text={}".format(default_host), + "label=Enter IP for multiplayer server(eg. localhost)"), + ("f:multi", "Multiplayer"), ("f:exit", "Quit"))) + menu.screen = screen pygame.display.set_caption("Zombies Robots Pirates Ninjas")
