Re: Having issues when trying to divide my bgt script into functions

2015-04-22 Thread AudioGames . net Forum — Developers room : Genroa via Audiogames-reflector
Re: Having issues when trying to divide my bgt script into functions The image of the boxes is quite good to understand : when you give work to do to the playding box, it cant know what ding is if you tell it. So, give it the information as a parameter of the function, or set

Re: Having issues when trying to divide my bgt script into functions

2015-04-21 Thread AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
Re: Having issues when trying to divide my bgt script into functions yeah, I wanted to practice doing stuff in different functions. Eventually if I want to make a game I will have to do that.Thanks for the quick reply! URL: http://forum.audiogames.net/viewtopic.php?pid=213164#p213164

Re: Having issues when trying to divide my bgt script into functions

2015-04-21 Thread AudioGames . net Forum — Developers room : audiogames . net fan via Audiogames-reflector
Re: Having issues when trying to divide my bgt script into functions Hello,The thing is, the ding object is declared in the main function. That means that if you try to access it from another function, it will not recognise it. Think of it as 2 boxes. One is the main function, the other

Having issues when trying to divide my bgt script into functions

2015-04-21 Thread AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
Having issues when trying to divide my bgt script into functions Hey all.Ive run into an interesting and somewhat frustrating issue.Take a look at the following:void main(){show_game_window(ding);sound ding;ding.load(c:\\windows\\media\\ding.wav);wait(5);dingplay();}void dingplay

Re: Having issues when trying to divide my bgt script into functions

2015-04-21 Thread AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
Re: Having issues when trying to divide my bgt script into functions Declare the ding sound as global, that is above the main function, not inside it. Like this, you call the dingplay function from within void main but thesound is still local (available) only to the main function.Or