From 1fe19d3e589bbc5d40b74d007d6b1984cfc34925 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 8 Nov 2021 17:53:17 +0100 Subject: Make controller classes and screen classes inherit from abstract classes Signed-off-by: Olivier Gayot --- cameltris.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cameltris.py') diff --git a/cameltris.py b/cameltris.py index b454db2..50ebb01 100755 --- a/cameltris.py +++ b/cameltris.py @@ -4,7 +4,8 @@ import argparse import pygame -from pycameltris.controller import KeyboardController, JoystickController +from pycameltris.controller import Controller, KeyboardController, JoystickController +from pycameltris.screens.Screen import Screen from pycameltris.screens.InGame import InGame as InGameScreen, Player from pycameltris.screens.Pause import Pause as PauseScreen from pycameltris.misc import Pause, UnPause @@ -23,6 +24,7 @@ pygame.init() screen = pygame.display.set_mode((801, 1000)) +controller: Controller if ARGS["joystick_id"] is not None: joystick = pygame.joystick.Joystick(ARGS["joystick_id"]) joystick.init() @@ -38,6 +40,7 @@ for player in players: clock = pygame.time.Clock() +current_screen: Screen current_screen = ingame_screen = InGameScreen(players, screen) while True: -- cgit v1.2.3