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.

DarkBASIC Discussion / Sound error.

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 21st Feb 2005 10:39
Hello

I am trying to add a simple explosion sound to my game each time the projectile explodes. Now at first I thought I would simply stick the "play sound command" in the explosion subroutine, but upon start up my game would simply play the sound over and over again in a loop even though the subroutine was not being called, So I added the following code to the subroutine...

If sound playing(2)=0
play sound 2
endif

That didn't work either. Now I don't know what to do, I want the sound to play each time the object explodes, but I can't even do that much, any help would be appreciated.

Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Feb 2005 13:58
Show us some code, and we can point out where you went wrong

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 22nd Feb 2005 05:58
Well my code is such garbage, I may be to embarrased , but ok....

The command to play the sound is included in the explosion subroutine at the very end...



Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 24th Feb 2005 10:39
I really hate to bumb things like this, but I want to give the community a chance to try and answer a rather important question of mine.

How can I get the explosion sound to play when the bomb explodes? The code is above.

Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 24th Feb 2005 23:26
i think this should work but havn't tested it



The happenings of tommorow are behind us now
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 25th Feb 2005 06:27
Nope, the sound plays once at the start of the loop, but never comes back. Any other suggestions?

Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Monsieur Mort
20
Years of Service
User Offline
Joined: 12th Feb 2005
Location:
Posted: 25th Feb 2005 06:43
yes. i think you need to do what robot did, but include another line saying if sound playing(2)=0 then soundplay=0

Why do you sink I ave zees outRAGEOUS accente?!
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 25th Feb 2005 06:54
thanks, that did the trick, the sound now plays when the nuke explodes , now I Just need to beef up the explosion with some more effects!

Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 25th Feb 2005 15:17
oops i made a mistake in the code at the end it should have said soundplay=0

The happenings of tommorow are behind us now

Login to post a reply

Server time is: 2025-05-23 21:42:49
Your offset time is: 2025-05-23 21:42:49