-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (30 loc) · 1.07 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import multiprocessing
from game import SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE
def run_arcade(arcade_connection):
import arcade
from game import MainMenu
window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
menu_view = MainMenu(arcade_connection)
window.show_view(menu_view)
arcade.run()
"""
from game import Game
game_instance = Game(arcade_connection)
game_instance.setup()
arcade.run()
"""
def run_kivy(kivy_connection):
from uix import Input
input_window = Input(kivy_connection)
input_window.run()
def main():
""" Main method """
# Initialize connection between Arcade and Kivy through a (duplex) pipe
arcade_connection, kivy_connection = multiprocessing.Pipe(duplex=True)
# Initialize and start arcade and kivy processes
arcade_process = multiprocessing.Process(target=run_arcade, args=[arcade_connection])
arcade_process.start()
kivy_process = multiprocessing.Process(target=run_kivy, args=[kivy_connection])
kivy_process.start()
if __name__ == "__main__":
main()