def restart(self): self.player = Player() self.player.rect.center = self.bounds.center self.coins = CoinGroup(self.bounds) # create initial coins for i in range(self.initial_coins): self.coins.spawn() play_song(self.song)
def restart(self): self.player = Player() self.player.rect.center = self.bounds.center self.coins = CoinGroup(self.bounds) # create initial coins for i in range(self.initial_coins): self.coins.spawn() # start the background music play_song(self.song)
def __init__(self, screen, mute): self.screen = screen self.bounds = self.screen.get_rect() self.title_font = pygame.font.Font(None, 170) self.menu_font = pygame.font.Font(None, 70) self.maps_font = pygame.font.Font(None, 50) self.background_colour = (0, 0, 0) self.menu_off = False self.main = True self.maps = False self.map = None self.controls = False self.rules = False play_song("Chopin") self.mute = mute self.items = ["Play", "Controls","Rules"] self.rects = [] while self.menu_off == False: self.update() pygame.mixer.music.stop()
def restart(self): # start the background music play_song(self.song) self.player = Player