3
game module. Contains the Game class.
8
from python_name import python_nameconfig
12
Game - manages game data and functions, such as lives, score,
13
level and paused or unpaused.
18
Creates a new Game object. To start or restart the game
25
self.free_guys_from_points = 1
27
self.free_guy_sound = pygame.mixer.Sound(project_nameconfig.free_guy_sound)
30
def add_free_guy(self):
31
"""add_free_guy - increments the game's lives by 1 and plays a sound.
32
Can by called due to the player scoring enough points, or called
33
directly, for example due to a power.
38
self.free_guy_sound.play()
40
def increase_score(self, points):
41
"""increase_score - increase the score by the points specified.
42
Will increment points and aware free guys as needed
48
self.score += points * self.multiplier
49
if (self.free_guys_from_points * self.free_guy_at) < self.score:
51
self.free_guys_from_points += 1
54
"""reset - reset or start the game"""