Skip to content

Commit

Permalink
changed stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Samantha Wu committed May 27, 2016
1 parent 7c08e22 commit cb75f65
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions snakeGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def home(self):
self.frame1.update()

# start button so player can start the game
start = Button(self.frame1, text="start", bg="black", command=lambda: self.callgame(100))
start = Button(self.frame1, text="start", highlightbackground="black", command=lambda: self.callgame(100))

# score button
showScore = Button(self.frame1, text="Show Score", bg="black", command=lambda: self.showScore())
showScore = Button(self.frame1, text="Show Score", highlightbackground="black", command=lambda: self.showScore())

# display start button
start.grid(row=0, columnspan=2)
Expand Down Expand Up @@ -244,7 +244,7 @@ def arrow(self, direction, i):
self.w.delete(1)
self.w.delete(self.head)
self.w.delete(self.food)
self.restart = Button(self.root, text="Restart", command=lambda: self.callhome())
self.restart = Button(self.root, highlightbackground="black", text="Restart", command=lambda: self.callhome())
self.restart.pack(side="bottom")

# down arrow
Expand Down Expand Up @@ -382,16 +382,16 @@ def callhome(self):
self.scoreC.destroy()

# ask for name
self.input = Label(self.root, text="Name (3 CHAR ONLY)", bg = "black", fg = "white")
self.input.pack( side = LEFT)
self.input = Label(self.root, text="Name (3 CHAR ONLY)", bg = "black", fg = "white", padx = 10)
self.input.pack(side = LEFT)

# create input box
self.entry = Entry(self.root, bd =5)
self.entry = Entry(self.root)
self.entry.pack(side = LEFT)

# submit button
self.submit = Button(self.root, text="submit", bg="black", command=lambda: self.store(self.entry.get().strip()))
self.submit.pack(side = RIGHT)
self.submit = Button(self.root, text="submit", highlightbackground="black", command=lambda: self.store(self.entry.get().strip()))
self.submit.pack(side = LEFT)

def store(self, name):

Expand All @@ -408,6 +408,7 @@ def store(self, name):

# display Score
def showScore(self):

# close start window
self.frame1.destroy()

Expand All @@ -418,11 +419,11 @@ def showScore(self):
self.displayScore()

# draw back button
self.back = Button(self.frame2, text="Back", bg="black", command=lambda: self.backToStart())
self.back = Button(self.frame2, text="Back", highlightbackground="black", command=lambda: self.backToStart())
self.back.pack(side="bottom")

# draw reset button
self.resetScore = Button(self.frame2, text="Reset", bg="black", command=lambda: self.reset())
self.resetScore = Button(self.frame2, text="Reset", highlightbackground="black", command=lambda: self.reset())
self.resetScore.pack(side="bottom")

# draw score window
Expand Down

0 comments on commit cb75f65

Please sign in to comment.