def __init__(self, master, gameplay: FourInARowGameplay): Section.__init__(self, master, "Local Multiplaying", gameplay) self.form = Form(self) self.form.add_entry("P1", Text("P1 Name:", theme="form"), Entry(self)) self.form.add_entry("P2", Text("P2 Name:", theme="form"), Entry(self)) self.button_play = Button(self, "Play", theme=["option", "section"], callback=self.play)
def __init__(self, master, **kwargs): Dialog.__init__(self, master=master, bg_color=GREEN_DARK, **kwargs) self.start_game = master.start_game self.text_title = Text("Connect to Player 1", font=("calibri", 50)) self.form = Form(self) self.form.add_entry("IP", Text("IP address", font=("calibri", 40), color=YELLOW), Entry(self, width=15, font=("calibri", 30), bg=GREEN, highlight_color=YELLOW, outline=2)) self.form.add_entry("Port", Text("Port", font=("calibri", 40), color=YELLOW), Entry(self, width=15, font=("calibri", 30), bg=GREEN, highlight_color=YELLOW, outline=2)) self.text_connection = Text(font=("calibri", 25), color=YELLOW) self.text_connection.hide() self.button_connect = Button(self, "Connection", theme="option", callback=self.connection) self.button_cancel = Button(self, "Return to menu", theme="option", callback=self.stop) self.lets_play_countdown = CountDown(self, 3, "Connected.\nGame start in {seconds} seconds", font=("calibri", 35), color=YELLOW, justify="center")
def __init__(self, master, gameplay: FourInARowGameplay): Section.__init__(self, master, "Play as P1", gameplay) self.form = Form(self) self.form.add_entry("P1", Text("Your Name:", theme="form"), Entry(self)) self.button_start_server = Button(self, theme=["option", "section"]) self.text_game_status = Text(font=RESOURCES.font("heavy", 20), shadow_x=1, shadow_y=1) self.text_server_ip = Text(font=RESOURCES.font("afterglow", 45), shadow_x=2, shadow_y=1) self.text_server_port = Text(font=RESOURCES.font("afterglow", 45), shadow_x=2, shadow_y=1)
def __init__(self, master, gameplay: FourInARowGameplay): Section.__init__(self, master, "Play as P2", gameplay) self.form = Form(self) self.form.add_entry("name", Text("Your Name:", theme="form"), Entry(self)) self.form.add_entry("IP", Text("IP address:", theme="form"), Entry(self, width=15)) self.form.add_entry("port", Text("Port:", theme="form"), Entry(self, width=15)) self.button_connect = Button(self, "Connect to P1", theme=["option", "section"], callback=self.connection) self.text_game_status = Text(font=RESOURCES.font("heavy", 30), shadow_x=1, shadow_y=1)