-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainMenu.py
More file actions
33 lines (26 loc) · 971 Bytes
/
mainMenu.py
File metadata and controls
33 lines (26 loc) · 971 Bytes
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
from tkinter import *
import gameBoard
class MainMenu:
def __init__(self):
self.master = Tk()
self.canvas = Canvas(self.master, width=400, height=400)
self.canvas.pack()
self.addLabels()
self.addButtons()
self.master.mainloop()
def addLabels(self):
l1 = Label(self.canvas, text="Checkers")
l1.config(font=("Courier", 44))
l1.pack()
l2 = Label(self.canvas, text="Select one of the following options:\n")
l2.config(font=("Courier", 10))
l2.pack()
def addButtons(self):
button1 = Button(self.master, text="Player vs Player", command=lambda: self.test(1))
button2 = Button(self.master, text="Player vs AI", command=lambda: self.test(2))
button3 = Button(self.master, text="AI vs AI", command=lambda: self.test(3))
button1.pack()
button2.pack()
button3.pack()
def test(self, x):
gameBoard.GameBoard(x)