Changeset 269:9fcdb106424a for nagslang


Ignore:
Timestamp:
Sep 4, 2013, 10:54:26 PM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
rebase_source:
ace2695e4f002b9ee468a41417d66d13dae49343
Message:

Add first draft of sound support.

Location:
nagslang
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • nagslang/__main__.py

    r85 r269  
    77from nagslang.constants import SCREEN
    88from nagslang.engine import Engine
     9from nagslang.sound import sound
    910
    1011
     
    1718    #pygame.display.set_icon(load_image(...))
    1819    pygame.display.set_caption('Nagslang')
     20    sound.init()
    1921
    2022    screen = pygame.display.get_surface()
  • nagslang/constants.py

    r265 r269  
    88    sound=True,
    99)
     10
     11# Sound constants
     12FREQ = 44100   # same as audio CD
     13BITSIZE = -16  # unsigned 16 bit
     14CHANNELS = 2   # 1 == mono, 2 == stereo
     15BUFFER = 1024  # audio buffer size in no. of samples
    1016
    1117COLLISION_TYPE_OTHER = 0
  • nagslang/screens/area.py

    r266 r269  
    1111from nagslang.screens.base import Screen
    1212from nagslang.game_object import Bullet
     13from nagslang.sound import sound
    1314
    1415
     
    8283            self.add_protagonist()
    8384        self.add_game_objects()
     85        sound.play_music("POL-cyber-factory-short.ogg")
    8486
    8587    def _collision_pre_solve_handler(self, space, arbiter):
Note: See TracChangeset for help on using the changeset viewer.