|
Post by hartnell on Nov 19, 2006 3:54:02 GMT -5
First, let me say I love the new SFX object. However, the way it's set up is inconvenient. When I play a note, I have the option of either stopping the game to play it, or I have the option of writing extra of code to manage the sound effect. I recommend : SFX.PlayNoteAutoStop value, length This will work like SFX.PlayNote, but internally will use SFX.StartNote and SFX.StopNote so the game will not have to pause. -hartnell
|
|
|
Post by Guilect on Nov 19, 2006 11:08:55 GMT -5
That is an excellent idea. However, I think that it might not be technically possible.
When you choose something, anything, there are always pluses and minuses to it. When I chose to use VBScript the plus was that I did not have to write a parser/executor for things like "if-then", "for-next", or have to worry about the handling of variables. VBScript did that all automatically. Great. But the down side is it is impossible (AFAIK) to do what you are asking for behind the scenes of Brutus2D. That is, once your program is running in Brutus2D to externally control it without some command in your script being run to do so. It may not seem to make sense or sound confusing, but there would be a lot of things that I would like to do if it would let me.
I said this in another recent post: There is ideal world (what you would like to do) and then there is real world (what you can do).
I will spend some time to see if there is a clever way to get this to happen.
The alternative would be to write a sub routine or function in Brutus2D that would do what you ask.
|
|
|
Post by hartnell on Nov 19, 2006 17:33:53 GMT -5
I'll see if I can get it to work using VBScript and send you the results.
-hartnell
|
|
|
Post by u9 on Nov 19, 2006 18:57:28 GMT -5
I was just wondering, can't it be done in the same way that you are able to move images around the screen based on time? It's a brilliant request btw
|
|
|
Post by Guilect on Nov 19, 2006 20:31:21 GMT -5
I pictured the requested command as a set and forget command.
To implement it in the way that the time-based commands are would require that there be a command in some loop somewhere to update the time information. With the time-based commands, behind the scenes, they are updated with every occurance of the command graphics.SetImage. To display a time-based image you need this .SetImage command. And for the .SetImage command to work it needs to be in your game loop. So it all works out nicely.
For sound there is no required command that needs to be placed in some loop to be constantly updated.
I could implement a new command, something like SFX.Update, that you would have to place in a loop in order for the playnoteautostop command to function properly. But it would be nice to be able to just set a command somewhere in the code and have the sound stop on its own, with out a dependence on some other command hopefully in an active loop somewhere. That was what I was after.
|
|
|
Post by hartnell on Nov 19, 2006 20:52:53 GMT -5
The SFX.Update was my solution too. It's no more complex than graphics.Display. Hey, how about SFX.Play? -hartnell
|
|