Re: How to Handle Sounds in BGT

Thank you for the replies, I want to ask a couple follow up questions. primarily about the preloading.

At Hijacker:

I think part of my problem is that I don't know much about sounds to begin with, it makes sense to load all of my sounds before the game loads in a single object, but how do you access them? It has to be hard to keep track of which index is associated with which sound assuming we store them as an array. If a dictionary, what would you use as a key, because if you gave every sound a unique name, it would be very tedious to go through and load all the sounds by hand, it is much easier to give generic names, that are numbered, so you can load them using a loop, but I would imagine that it is hard to work with those sounds.
So as I start creating my classes for the player and, monsters, and other game objects, I want to create a handle for the sound as a class level variable, so that I can use a constructor to point the handle at the given sound ob ject, right? I do not want to load the sound in each object such as in the constructor?
And I think this is where my inexperience about using sounds is going to really show, what do you mean about encrypting and decrypting sounds? Why do you need to deal with encryption at all when working with sounds?
What do you mean by:
"In this case you can use existing objects when in game without the need of loading them from hard drive when playing actively."

I only asked about the global variables because all of the game based tutorials I have seen, mostly python based,  including BGT, seem to use and often encourage using global variables. So I started wondering if global variables are used more in game programming than else where? it kind of makes sense because if you have to access a central object where all of your sounds are stored, it seems like it would not be very efficient to pass that object through to every class and function that needs to acces s a sound. Also, for timers, and other game states, it also seems to make sense to set these as global. Is this what most people are doing, or is there another method of handling these game properties.

That makes a lot of sense about the listener and source now. So just to be clear, if I wanted to give the player a sound when they are moving, I would set the listener and the source to the coordinates of the player's position?

TJ Breitenfeldt

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TJ . Breitenfeldt via Audiogames-reflector

Reply via email to