Permalink
Browse files

added type sound

  • Loading branch information...
1 parent a118900 commit 422b977a1bc4c721e324d559bfb4d315cb8c8499 michael committed Jul 29, 2012
Showing with 7 additions and 4 deletions.
  1. +2 −2 sources/game.py
  2. +4 −1 sources/hud.py
  3. +1 −1 sources/load_resources.py
View
4 sources/game.py
@@ -104,15 +104,15 @@ def game():
for i in range(1):
enemy_list.append(enemy.Enemy( single_sprites, sprite_sequences , sounds,
i*80+250+60*int(boolrand), -single_sprites['sprite_enemy.png'].get_height(),boolrand , 0, menu))
- print (enemy_list[0].nbAsteroids)
+ #print (enemy_list[0].nbAsteroids)
if level==2:
if compteur%(2*60)==0:
boolrand = bool(random.getrandbits(1))
for i in range(6):
enemy_list.append(enemy.Enemy( single_sprites, sprite_sequences , sounds,
i*80+190+60*int(boolrand), -single_sprites['sprite_enemy.png'].get_height(),boolrand , 0, menu))
- print (enemy_list[0].nbAsteroids)
+ #print (enemy_list[0].nbAsteroids)
if level==3 and not spawnedBoss:
enemy_list.append(enemy.Enemy( single_sprites, sprite_sequences , sounds,
400-single_sprites['boss1.png'].get_width()/2, -single_sprites['boss1.png'].get_height(),1 , 2, menu))
View
5 sources/hud.py
@@ -100,6 +100,9 @@ def blit(self, ship, level):
#beggining of the game : blit johnson
if level==0:
+ if self.johnsonOffset%1==0 and self.johnsonOffset>30 and self.johnsonOffset<180:
+ self.menu.play_sound(self.sounds["click.wav"])
+
if self.johnsonOffset==230:
return 1
else:
@@ -124,7 +127,7 @@ def blit(self, ship, level):
screen.blit(self.communication.render(self.textline4[:(self.johnsonOffset-150)*len(self.textline4)/30], True, (255,255, 128)),(114, 44+18+18))
else:
- if self.johnsonOffset == 200:
+ if self.johnsonOffset == 201:
self.menu.play_sound(self.sounds["noise.wav"])
if self.johnsonOffset%8>4:
screen.blit(self.communicationCall.render("Transmission end", True, (255,255,255)),(20, 15))
View
2 sources/load_resources.py
@@ -34,7 +34,7 @@ def load_resources(pygame_arg):
prog.update(0)
soundlist=["laser.wav", "laser2.wav", "laser3.wav", "laser4.wav","laser5.wav", \
"explosion.wav", "explosion2.wav", "life.wav", "ouch.wav", "loser.wav", "shield1.wav", \
- "armor.wav", "plasma1.wav", "plasmagun.wav", "noise.wav", "menu.wav"]
+ "armor.wav", "plasma1.wav", "plasmagun.wav", "noise.wav", "menu.wav", "click.wav"]
for index in xrange (len(soundlist)):
add_sound(soundlist[index])

0 comments on commit 422b977

Please sign in to comment.