Skip to content

Commit c1ec8f6

Browse files
committed
changeable font color
1 parent dbd578a commit c1ec8f6

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
WINDOW_POSITION_Y = 0
1111
WINDOW_BORDER = False
1212

13+
# UI settings
14+
FONT_COLOR = (255, 226, 165)
15+
1316
# game settings
1417
BLOCKSIZE = 25
1518
SNACKS = 10

highscore.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29
1+
41

snake.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def headDied(self, elements):
141141
or self.playerBox.y > (self.SCREEN_HEIGHT / self.BLOCKSIZE)-1:
142142
dead = True
143143

144-
if dead == True:
144+
if dead:
145145
highscores = '0'
146146
scores = self.getBodyLen()
147147
if os.path.isfile("highscore.txt") is True:
@@ -160,7 +160,7 @@ def headDied(self, elements):
160160
"Button / Keyboard: 2 = Speed Up",
161161
"Button / Keyboard: 1 = Speed Down",
162162
"R = restart / respawn",
163-
"Q = Quit / Exit"])
163+
"Q = Quit / Exit"], color=conf.FONT_COLOR)
164164
self.iUi.draw("gameOver")
165165

166166
return dead
@@ -231,6 +231,7 @@ def run_game(self):
231231
# init the menu, add stuff later
232232
self.iUi = ui(self.screen)
233233
self.popUp = popUp(self.screen)
234+
self.popUp.color = conf.FONT_COLOR
234235

235236
pygame.joystick.init()
236237
self.joystickInteract = joystick()

0 commit comments

Comments
 (0)