summaryrefslogtreecommitdiff
path: root/src/sliceitoff/game
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-04-26 12:08:06 +0300
committerViljami Ilola <+@hix.fi>2024-04-26 12:08:06 +0300
commit54a17d969c85e150486e0960e90ab166e945c359 (patch)
treef76e57dddb2ad92fc043c48ea1bb118207b06c73 /src/sliceitoff/game
parent2d94bb60ff2fea09097d0e33dfd8b92aeef55531 (diff)
initial music
Diffstat (limited to 'src/sliceitoff/game')
-rw-r--r--src/sliceitoff/game/explodeout.py2
-rw-r--r--src/sliceitoff/game/game.py2
-rw-r--r--src/sliceitoff/game/level.py3
-rw-r--r--src/sliceitoff/game/mainmenu.py2
4 files changed, 9 insertions, 0 deletions
diff --git a/src/sliceitoff/game/explodeout.py b/src/sliceitoff/game/explodeout.py
index 34bd9fe..6cebec5 100644
--- a/src/sliceitoff/game/explodeout.py
+++ b/src/sliceitoff/game/explodeout.py
@@ -1,6 +1,7 @@
""" game.explodeout - For showing explogind effect and waiting for a key """
import pygame
+from sliceitoff.sfx import sfx
from .anykey import anykey
class ExplodeOutGroup(pygame.sprite.Group):
@@ -31,4 +32,5 @@ class ExplodeOutGroup(pygame.sprite.Group):
def do_fadeout(self):
""" Just kicks off exploding phase """
+ sfx.play("glass")
self.explode = True
diff --git a/src/sliceitoff/game/game.py b/src/sliceitoff/game/game.py
index a5009c5..c6a5fe0 100644
--- a/src/sliceitoff/game/game.py
+++ b/src/sliceitoff/game/game.py
@@ -47,6 +47,7 @@ class Game:
def show_highscores(self):
""" displays highscores and waits a key """
+ sfx.music("pimpelipompeli")
his = Show(hiscores_screen(str(self.hiscores)))
while his.active:
his.update(dt = self.clock.tick())
@@ -73,6 +74,7 @@ class Game:
def mainmenu(self):
""" menu where one select what to do """
+ sfx.music("pimpelipompeli")
menu = Mainmenu()
while menu.active:
menu.update(dt = self.clock.tick())
diff --git a/src/sliceitoff/game/level.py b/src/sliceitoff/game/level.py
index c3713ce..9f3121f 100644
--- a/src/sliceitoff/game/level.py
+++ b/src/sliceitoff/game/level.py
@@ -6,6 +6,7 @@ from sliceitoff.player import Player, Life
from sliceitoff.field import Field
from sliceitoff.enemies import Enemies
from sliceitoff.screens import levelup_screen, gameover_screen, level_screen
+from sliceitoff.sfx import sfx
from .gameplay import Gameplay
from .show import Show
@@ -32,6 +33,8 @@ class Level(pygame.sprite.Group):
stats = self.stats,
life = self.life)
+ sfx.music("uhkapeli")
+
def update(self, dt = 0):
""" Updates groups, calls gameplay and adds sprites for drawing """
self.empty()
diff --git a/src/sliceitoff/game/mainmenu.py b/src/sliceitoff/game/mainmenu.py
index edb1594..f9a70e0 100644
--- a/src/sliceitoff/game/mainmenu.py
+++ b/src/sliceitoff/game/mainmenu.py
@@ -4,6 +4,7 @@ import pygame
from sliceitoff.screens import mainmenu_screen
from sliceitoff.display import Scaling
+from sliceitoff.sfx import sfx
from .explodeout import ExplodeOutGroup
@@ -63,6 +64,7 @@ class Mainmenu(ExplodeOutGroup):
case pygame.K_ESCAPE | pygame.K_q | pygame.K_LEFT:
self.selection = MenuItems.QUIT
self.do_fadeout()
+ sfx.music(None)
return True
case pygame.K_UP:
self.selection -= 1