Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project Zavi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mihkelhain
Project Zavi
Commits
0b032581
Commit
0b032581
authored
4 months ago
by
Jantz
Browse files
Options
Downloads
Patches
Plain Diff
Added turret placement sound
parent
d88fd747
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
assets/sounds/turret_placement.mp3
+0
-0
0 additions, 0 deletions
assets/sounds/turret_placement.mp3
sound.py
+2
-0
2 additions, 0 deletions
sound.py
world.py
+1
-0
1 addition, 0 deletions
world.py
with
3 additions
and
0 deletions
assets/sounds/turret_placement.mp3
0 → 100644
+
0
−
0
View file @
0b032581
File added
This diff is collapsed.
Click to expand it.
sound.py
+
2
−
0
View file @
0b032581
...
...
@@ -7,6 +7,7 @@ bullet_sound = pg.mixer.Sound('assets/sounds/bullet.mp3')
zombie_groan_1
=
pg
.
mixer
.
Sound
(
'
assets/sounds/zombie_groan_1.mp3
'
)
zombie_groan_2
=
pg
.
mixer
.
Sound
(
'
assets/sounds/zombie_groan_2.mp3
'
)
round_win
=
pg
.
mixer
.
Sound
(
'
assets/sounds/round_win.mp3
'
)
turret_placement
=
pg
.
mixer
.
Sound
(
'
assets/sounds/turret_placement.mp3
'
)
# Set the volume of the sounds
...
...
@@ -15,6 +16,7 @@ bullet_sound.set_volume(0.2)
zombie_groan_1
.
set_volume
(
0.2
)
zombie_groan_2
.
set_volume
(
0.2
)
round_win
.
set_volume
(
0.6
)
turret_placement
.
set_volume
(
0.6
)
def
play_zombie_groan
():
"""
Plays a random zombie groan sound.
"""
...
...
This diff is collapsed.
Click to expand it.
world.py
+
1
−
0
View file @
0b032581
...
...
@@ -78,6 +78,7 @@ class World:
collision
=
any
(
temp_turret
.
rect
.
colliderect
(
sprite
.
rect
)
for
sprite
in
self
.
turret_group
)
if
not
collision
:
self
.
turret_group
.
append
(
temp_turret
)
sound
.
turret_placement
.
play
()
self
.
money
-=
temp_turret
.
cost
def
turret_attacks
(
self
,
dt
:
float
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment