Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sound loop problem

Author
Message
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 13th Mar 2004 22:03
How do you stop the sound from not playing and soundin like a machine gun until the key is pressed in a variable loop.

if p1win = 1
play sound 2
if spacekey() = 1 the gosub reset_variables
endif

Thanks for your help,

Michael

Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Mar 2004 22:36
wrap the sound looping code in a condition if-then test to test for the actual keypress state of the fire button


"What the... Moooooooo!"
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 13th Mar 2004 22:38
Sorry its for a crowd cheer sound but it just goes wierd and sounds like a machine gun.

Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro
Tim Ballisto
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 13th Mar 2004 23:33 Edited at: 13th Mar 2004 23:35
if p1win=1 and sound playing(2)=0 then play sound 2
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 14th Mar 2004 00:17
cheers! How do you do "if sound 2 has finished"? Is there a command for this?

Thanks,

Michael

Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Mar 2004 01:28 Edited at: 14th Mar 2004 01:30
Quote: "How do you do "if sound 2 has finished"?"


he just did with
Quote: "sound playing(2)=0"


if sound 2 is playing the value 1 is returned, otherwise 0 is returned
Its only looping because he is not replaying the sound until it has finished


"What the... Moooooooo!"
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 14th Mar 2004 10:38
I know that. I wanted to now how to write if it has played but then it has stopped?

Cheers,

Michael

Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 14th Mar 2004 15:21
remember to set sound_played back to zero from within reset_variables
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Mar 2004 16:57
you mean you want to track if it has played at least once?
I guess set a boolean flag the first time the sound plays and check that later.


"What the... Moooooooo!"
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 14th Mar 2004 17:05
Cheers. I'll try that.

Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Mar 2004 17:22



"What the... Moooooooo!"

Login to post a reply

Server time is: 2024-09-22 00:34:32
Your offset time is: 2024-09-22 00:34:32