Пример #1
0
    def __init__(self,
                 event_loop: "TwistedEventLoop",
                 input_handler=None,
                 window: Window = None):
        super().__init__(event_loop)
        self.my_model = self.smf.manufacture("ship",
                                             position=self.random_position())
        self.models[self.my_model.uuid] = self.my_model
        self.controller_factory = ControllerFactory()
        self.my_controller = None

        if window is None:
            self.window: Window = Window(self.my_model,
                                         input_handler=input_handler)
        else:
            self.window: Window = window
        self.window.connect = self.connect
        if input_handler is not None:
            self.input_handler = input_handler
        else:
            self.input_handler = Keyboard(self.window)

        self.window.push_handlers(self)
        self._stop_func = lambda: print("nothing bound to stop")
        self.connect_func = lambda x, y: print("nothing bound to connect")

        self._menu_left = 200
        self._menu_bottom = 600
        self._main_menu_functions = [
            self._menu_start_local, self._menu_shipyard, self._menu_controls,
            self._menu_network, self.exit
        ]
        self.callsign = None
        self._menu_login()
        self._event_loop.clock.set_fps_limit(self.fps)
Пример #2
0
# Copyright (C)2011 Julian Ceipek and Patrick Varin
#
# Redistribution is permitted under the BSD license.  See LICENSE for details.
#

from engine.ui import UI
from engine.manager import Manager
from engine.window import Window

from screens import MenuScreen

#resolution = (640,480)
resolution = (1344, 840)
#resolution = (1440,900)

window = Window(resolution, windowTitle="Mind Rush")

manager = Manager()
window.registerManager(manager)

#-------------------------------------------------------------------------
#         Uncomment the lines below to obtain bio-feedback control
#         You may need to modify '/dev/tty.usbmodem621' to match
#         the location of the Arduino communication port on your
#         machine. On Windows, this will be 'COM3' or higher,
#         and on Linux, it will be similar to '/dev/ttyAMC0'.
#         For instructions on obtaining this string, look through
#         http://arduino.cc/en/Guide/HomePage
#-------------------------------------------------------------------------
#from biofeedback import Biofeedback
#arduinoInput = Biofeedback('/dev/tty.usbmodem621',
Пример #3
0
import pygame
import time

from engine.window import Window
from engine.events import Events
from engine.loader import Loader
from engine.scenes import Map
from engine.entities.player import Player


# ----- Initialisation ------
        # Pygame
pygame.init()

        # Window
game_window = Window()
game_display = game_window.game_display
game_window_settings = game_window.getWindowSize()


        # Events
loop = True
event_manager = Events()


        # Loader
loader = Loader()


        # Entities
user_player = Player()
Пример #4
0
 def __init__(self, config: Config):
     self.config = config
     self.window = Window(self.config)
     self.sprite_manager = SpriteManager()
     self.state = State()
Пример #5
0
def main():
    window = Window()
    window.initialize(engine)
    window.showWindow()