-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathgame.py
25 lines (21 loc) · 825 Bytes
/
game.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
import pygame
from settings import WIDTH, HEIGHT
pygame.font.init()
class GameIndicator:
def __init__(self, screen):
self.screen = screen
self.font = pygame.font.SysFont('Bauhaus 93', 60)
self.inst_font = pygame.font.SysFont('Bauhaus 93', 30)
self.color = pygame.Color("white")
self.inst_color = pygame.Color("black")
def show_score(self, int_score):
bird_score = str(int_score)
score = self.font.render(bird_score, True, self.color)
self.screen.blit(score, (WIDTH // 2, 50))
def instructions(self):
inst_text1 = "Press SPACE button to Jump,"
inst_text2 = "Press \"R\" Button to Restart Game."
ins1 = self.inst_font.render(inst_text1, True, self.inst_color)
ins2 = self.inst_font.render(inst_text2, True, self.inst_color)
self.screen.blit(ins1, (95, 400))
self.screen.blit(ins2, (70, 450))