Changeset 612:d9e7009bec9f for nagslang


Ignore:
Timestamp:
Sep 7, 2013, 10:43:59 PM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
rebase_source:
51fcb9682439e838a797402782cd93f0f5fd9fb4
Message:

Bullet sounds.

Location:
nagslang
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nagslang/enemies.py

    r603 r612  
    122122                result.add += (Bullet(
    123123                    self.get_space(), self.physicser.position, vec, damage,
    124                     type_, COLLISION_TYPE_ENEMY),)
     124                    type_, COLLISION_TYPE_ENEMY,
     125                    "mouth_pop_2a.ogg"),)
    125126
    126127    def greedy_move(self, target):
  • nagslang/game_object.py

    r610 r612  
    638638class Bullet(GameObject):
    639639    def __init__(self, space, position, impulse, damage, bullet_type,
    640                  source_collision_type):
     640                 source_collision_type, bullet_sound=None):
    641641        body = make_body(1, pymunk.inf, position)
    642642        body.angle = impulse.angle
     
    654654        )
    655655        self.physicser.apply_impulse(impulse)
     656        if bullet_sound is not None:
     657            sound.play_sound(bullet_sound, 0.3)
    656658
    657659    def update(self, dt):
  • nagslang/protagonist.py

    r538 r612  
    312312        return Result(add=(Bullet(self.get_space(), self.physicser.position,
    313313                                  vec, BULLET_DAMAGE, 'bullet',
    314                                   COLLISION_TYPE_PLAYER),))
     314                                  COLLISION_TYPE_PLAYER,
     315                                  "vocoder2_short.ogg"),))
    315316
    316317    def claw(self):
Note: See TracChangeset for help on using the changeset viewer.