Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create sound-superclass for sound implementation in the future #2

Open
Nearoo opened this issue Jul 14, 2015 · 4 comments
Open

Create sound-superclass for sound implementation in the future #2

Nearoo opened this issue Jul 14, 2015 · 4 comments

Comments

@Nearoo
Copy link
Owner

Nearoo commented Jul 14, 2015

There's no programming done regarding playing sound. In it's current state, the game needs no sound, but if sound should be needed later down the road, it's better if a dummy-sound-engine is already implemented now.

A draft of how it could work:

class Sound:
    def load_sound(self, filename): # Load sound in advance
    def play_sound(self, filename): # Play sound if already loaded, otherwise load it before
    def stop_sound(self, filename):
    def load_music(self, filename): # Same applies here
    def play_music(self, filename):
    def stop_music(self, filename):
    def queue_music(self, filename):

It then gets passed the same way as Input, World or Graphics. Maybe sounds should even be bound to game-actors, so they can stop sounds they are currently playing... but that's something that can be decided in the future, and be added as a non-standard argument. (e.g. id = id(self))

@Nearoo
Copy link
Owner Author

Nearoo commented Jul 15, 2015

It's actually not that important currently. With the new engine argument in the components, it's very easy to implement it much later, when sound will be actually needed.

@snoogans775
Copy link

It will be straightforward to initiate a streaming music file.

How are collisions handled?

@snoogans775
Copy link

Sorry, I see you clarified the collision handler in another thread.

@Nearoo
Copy link
Owner Author

Nearoo commented Apr 7, 2017

Tell me if you need help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants