def game(self, assemble=True, parameter = None):
'''
Model game play
'''
self.layout.GameContainer.gathering([self.widget.GameImagebackground,
self.widget.GameImagepersoneone,
self.widget.GameImagepersonetwo])
self.layout.GameButtonwrapper.gathering([self.widget.GameButtonsave,
self.widget.GameButtonload,
self.widget.GameButtontitle])
self.layout.GameTextwrapper.gathering([self.widget.GameTextname,
self.widget.GameTextdialogue])
self.layout.GameFooter.gathering([self.layout.GameTextwrapper,
self.layout.GameButtonwrapper])
self.layout.GameLayout.gathering([self.layout.GameContainer,
self.layout.GameFooter])
if assemble == True:
# -- if state from text dialog is empty, it means game is not
# -- instance yet, it means the application is just running.
if self.widget.GameTextdialogue.state is None:
if parameter is not None and (isinstance(parameter, list) or isinstance(parameter, tuple)):
background, part, character, line, state = parameter
else:
part = 'intro'
line = -1
background = None
character = None
self.widget.GameImagepersoneone.reset()
self.widget.GameImagepersonetwo.reset()
self.widget.GameTextdialogue.part = [part, line]
self.behavior.event_dialogue(background, character)
self.widget.GameButtonsave.bound(event='on_press', bind=self.behavior.open_serialization)
self.widget.GameButtonload.bound(event='on_press', bind=self.behavior.open_serialization)
self.widget.GameButtontitle.bound(event='on_press', bind=self.behavior.open_home)
self.widget.GameTextdialogue.bound(event='on_touch_down', bind=self.behavior.touched_event_dialogue)
self.behavior.animation_game_up()
self.layout.GameContainer.adding
self.layout.GameButtonwrapper.adding
self.layout.GameTextwrapper.adding
self.layout.GameFooter.adding
self.layout.GameLayout.adding
else:
self.layout.GameContainer.removing
self.layout.GameButtonwrapper.removing
self.layout.GameTextwrapper.removing
self.layout.GameFooter.removing
self.layout.GameLayout.removing
return self.layout.GameLayout