-Correction d'un bug d'enregistrement
-Lancement de la classe game lorsqu'un niveau est selectionné.
This commit is contained in:
parent
0636650edd
commit
7f8b8236a0
42
WireChem.py
42
WireChem.py
|
@ -160,31 +160,23 @@ class io(object):
|
||||||
'world_art': world_art}
|
'world_art': world_art}
|
||||||
|
|
||||||
|
|
||||||
''' *********************************************************************************************** '''
|
|
||||||
''' Fonction d'initialisation '''
|
|
||||||
|
|
||||||
#initialisation du jeu
|
|
||||||
def init():
|
|
||||||
global worlds, debug, level,inc
|
|
||||||
inout=io()
|
|
||||||
inout.verifyhome()
|
|
||||||
inout.read("dbdata")
|
|
||||||
inout.read(inout.gethome() + "/dbdata")
|
|
||||||
inout.reference(worlds, ['world', 'level'])
|
|
||||||
inout.reference(Uworlds, ['world', 'level'])
|
|
||||||
if len(sys.argv) > 1 and sys.argv[1] == 'debug':
|
|
||||||
debug = 1
|
|
||||||
else:
|
|
||||||
debug = 0
|
|
||||||
inc=1
|
|
||||||
|
|
||||||
''' *********************************************************************************************** '''
|
''' *********************************************************************************************** '''
|
||||||
''' initialisation '''
|
''' initialisation '''
|
||||||
|
global worlds, debug, level,inc
|
||||||
debug = 0
|
debug = 0
|
||||||
worlds = {}
|
worlds = {}
|
||||||
world = level = 0
|
world = level = 0
|
||||||
init()
|
inout=io()
|
||||||
|
inout.verifyhome()
|
||||||
|
inout.read("dbdata")
|
||||||
|
inout.read(inout.gethome() + "/dbdata")
|
||||||
|
inout.reference(worlds, ['world', 'level'])
|
||||||
|
inout.reference(Uworlds, ['world', 'level'])
|
||||||
|
if len(sys.argv) > 1 and sys.argv[1] == 'debug':
|
||||||
|
debug = 1
|
||||||
|
else:
|
||||||
|
debug = 0
|
||||||
|
inc=1
|
||||||
|
|
||||||
''' *********************************************************************************************** '''
|
''' *********************************************************************************************** '''
|
||||||
''' Classes graphiques
|
''' Classes graphiques
|
||||||
|
@ -818,7 +810,7 @@ class menu(pyglet.window.Window):
|
||||||
def on_mouse_double_logo2(self, state):
|
def on_mouse_double_logo2(self, state):
|
||||||
global debug
|
global debug
|
||||||
if debug == 2:
|
if debug == 2:
|
||||||
rebase()
|
inout.rebase()
|
||||||
self.on_mouse_press_logo(self)
|
self.on_mouse_press_logo(self)
|
||||||
|
|
||||||
def on_mouse_press_menu_2(self, state):
|
def on_mouse_press_menu_2(self, state):
|
||||||
|
@ -983,6 +975,7 @@ class menu(pyglet.window.Window):
|
||||||
for theicon in self.icons: theicon.hide()
|
for theicon in self.icons: theicon.hide()
|
||||||
|
|
||||||
def on_mouse_press_level(self, n, state):
|
def on_mouse_press_level(self, n, state):
|
||||||
|
global level
|
||||||
if debug == 2:
|
if debug == 2:
|
||||||
self.selected = -1
|
self.selected = -1
|
||||||
if state['modifiers'] & key.MOD_CTRL:
|
if state['modifiers'] & key.MOD_CTRL:
|
||||||
|
@ -1002,6 +995,13 @@ class menu(pyglet.window.Window):
|
||||||
else:
|
else:
|
||||||
l += 1
|
l += 1
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
level=n
|
||||||
|
super(menu,self).close()
|
||||||
|
thegame=game()
|
||||||
|
thegame.set_minimum_size(1024, 768)
|
||||||
|
pyglet.app.run()
|
||||||
|
|
||||||
|
|
||||||
### Evenement de la fenetre ###
|
### Evenement de la fenetre ###
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue