Changeset 263:44cd7cfd2de3


Ignore:
Timestamp:
04/08/11 09:47:33 (12 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Message:

Yelp when hit

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • data/sounds/sources.txt

    r262 r263  
    55Generated by Neil Muller, Aug 2010
    66Not copyrightable.
     7
     8[yelp.ogg]
     9URL: http://www.archive.org/download/tamtam44old/tamtam44old.zip
     10Source: http://www.archive.org/details/tamtam44old
     11License: http://creativecommons.org/licenses/by/3.0/
     12Credit: Sound samples for tamtam recorded by Richard Boulanger for use in the One Laptop per Child music library.  See http://wiki.laptop.org/go/Sound_samples for details
     13yelp.ogg wavfile: ounk.wav
     14
  • skaapsteker/levelscene.py

    r262 r263  
    2020        super(LevelScene, self).__init__(game_state, soundsystem)
    2121
    22         self._player = player.Player(game_state.world)
     22        self._player = player.Player(game_state.world, soundsystem)
    2323        self._level = level.Level(leveldef, self._player, soundsystem)
    2424        self._leveldef = leveldef
  • skaapsteker/sound.py

    r262 r263  
    4444            self._sounds[key] = None
    4545        else:
    46             self._sounds[key] = pygame.sound.Sound(data.filepath(track_name))
     46            self._sounds[key] = pygame.mixer.Sound(data.filepath(track_name))
    4747
    4848    def play_sound(self, key):
  • skaapsteker/sprites/player.py

    r253 r263  
    1717    wants_updates = True
    1818
    19     def __init__(self, the_world):
     19    def __init__(self, the_world, soundsystem):
    2020        Sprite.__init__(self)
    2121        self.image = None
    2222        self.rect = None
    2323        self._image_dict = {}
     24        self._soundsystem = soundsystem
     25        self._soundsystem.load_sound('yelp', 'sounds/yelp.ogg')
    2426        self._animation_frame = 0.0
    2527        self._last_time = time.time()
     
    157159    def damage(self, damage):
    158160        self.the_world.fox.cur_health -= damage
     161        self._soundsystem.play_sound('yelp')
    159162        if self.the_world.fox.cur_health <= 0:
    160163            PlayerDied.post()
Note: See TracChangeset for help on using the changeset viewer.