Feb-29-2020, 07:44 PM
How do I reference a method in my BoxLayout class from my App class?
class ConjugationGame(BoxLayout): round = 1 game_state = 0 def change_game_state(self): if self.game_state > 4: self.game_state == 1 else: self.game_state += 1 class ConjugationApp(App): def build(self): Window.bind(on_key_down=self.key_down) return ConjugationGame() def key_down(self, key, scancode=None, *_): if scancode == 281: # PAGE_DOWN print("PAGE_DOWN pressed") ConjugationGame.change_game_state()When I press Page Down, I get this error:
Quote:TypeError: change_game_state() missing 1 required positional argument: 'self'