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

I'm interested in your project #35

Open
LeonLucca opened this issue Dec 5, 2016 · 5 comments
Open

I'm interested in your project #35

LeonLucca opened this issue Dec 5, 2016 · 5 comments

Comments

@LeonLucca
Copy link

Hey I was wondering if you could help me out with something. I'm trying to get sound to play without the game crashing. Can you help with that? I also have questions about making a simple scoreboard for the game as well. Hopefully I hear from you soon :D

@snoogans775
Copy link

I can look at the sound script. Are there any events associated with the crash?

@LeonLucca
Copy link
Author

nah I just need help understanding what's going on in the sound.py file. If you can give me some clarification or advice on how to implement background music that would be great :)

@Nearoo
Copy link
Owner

Nearoo commented Dec 6, 2016

Hi, thanks for checking out my project! :-) I'm glad someone is interested in it!

I haven't bothered to implement a sound system into my engine yet. A sound module is already in place, it just misses an interface. I'm happily going to merge your changes to my project if you would create that for me.

Gameobjects inside my world interact with other gameobjects and the engine itself through the Engine Singleton Class. This class gets instantiate only once (as singletons do) inside main.py. After instancing all game objects, it passes itself down to them during every update cycle (see the "update" method of GameActorComponent). Each game object can then use it to interact, as mentioned before, with the engine. A game actor could then for instance blit something on the screen by calling engine.graphics.blit() (example), or check for collision with the world using engine.world.get_colliding_rects() (example). There are more variables like engine.graphics and engine.world that can be used to interact with the engine. They are defined here. One of them is sound. It's again a singleton class, defined in Sound.py. Which is where you should begin with implementing sound.

You could for instance create a set_background_music and a play_sound in the Sound-singleton class. You could also make a background music play automatically once a level loads inside the level-files loader. The Tiled-map-editor allows to add custom properties to a map, so maybe you could use that to define the background music for each map... just some ideas.

Hope that gets you started. Just ask if you need more information.

@snoogans775
Copy link

thank you very much for the rundown on your systems. I have done a little bit of sound design in pygame, but only through pygame.mixer. I am a musician and sound designer by trade so it should be enjoyable to learn the usage of the sound class and the Sound.py file. It should make it easier to organize sound events.

@Nearoo
Copy link
Owner

Nearoo commented Dec 31, 2016

Awesome! Can't wait for your contribution!

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

No branches or pull requests

3 participants