from kivy.logger import Logger, LoggerHistory
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.scrollview import ScrollView
-from kivy.uix.button import Button
+from kivy.uix.label import Label
from kivy.graphics import Color, Rectangle
from kivy.utils import platform
self.do_move(direction)
def do_move(self, direction):
+ if not self.level_obj:
+ return
self.nemesis.move(self.level_obj)
self.draw_nemesis()
self.player.move(direction, self.level_obj)
self.reset_timer()
def timed_move(self):
+ if not self.level_obj:
+ return
self.nemesis.move(self.level_obj)
self.draw_nemesis()
self.check_state()
Rectangle(pos=(0, 0), size=(1026, 760),
texture=self.image.texture)
- self.stop_button = Button(
- text='Quit', size=(200, 40),
+ self.stop_button = Label(
+ text='[ref=quit][color=ff0066]Quit[/color][/ref]',
+ font_size=30,
+ markup=True,
+ size=(200, 40),
pos=((1026 - 200) / 2 - 100, 100))
- self.stop_button.bind(on_press=self.app.stop_app)
- self.start_button = Button(
- text=self.START, size=(200, 40),
+ self.stop_button.bind(on_ref_press=self.app.stop_app)
+ self.start_button = Label(
+ text="[ref=start][color=00ff66]" + self.START + "[/color][/ref]",
+ font_size=30,
+ markup = True, size=(200, 40),
pos=((1026 - 200) / 2 + 100, 100))
- self.start_button.bind(on_press=self.app.start_game)
+ self.start_button.bind(on_ref_press=self.app.start_game)
self.add_widget(self.stop_button)
self.add_widget(self.start_button)
screen = IntroScreen(self)
self.root.add_widget(screen)
- def stop_app(self, button):
+ def stop_app(self, label, ref):
self.stop()
- def start_game(self, button):
+ def start_game(self, label, ref):
"""Start the game"""
game = GameWindow(self.levels, self)
game.build()