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 / play sound problem.

Author
Message
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 4th Feb 2005 00:01
Hi


Im making a little game were you walk around.
When you get close to a door it opens and play a sound. I use this code for the collision system NOTE: THIS CODE IS IN MY DO-LOOP :




Now when i hit the trigger object that will open the door the sound keeps playing and it sounds bad. I wan`t it to play only 1 time then stop. I have tried many way to get it work but i can`t.

Please help.

Thanks


The Nerd


looking for Royalty free 3D objects?
then Check PanzerGames at this link : http://www.freewebs.com/panzergames
Zokomoko
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 4th Feb 2005 00:17
What happens is that your cose checks collision between player and door.
Each loop, the collision check returns positive, which means the player and door do collide,so EACH LOOP the sound start playing over and over.

The solution would be to use a trigger, which means once the collision was detected, a sound would play, the door would open, a trigger would be made, and then the next loop will NOT check for the collision.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Feb 2005 00:23
if object collision(2,5) and sound playing(1) = 0

will fix it

BatVink
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 4th Feb 2005 00:37
If i do like this:



The door opens at the same time as the sound. And since the sound is a really short one the door is lagging.

How do i solve this problem?

Thanks

The Nerd


looking for Royalty free 3D objects?
then Check PanzerGames at this link : http://www.freewebs.com/panzergames
Zokomoko
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 4th Feb 2005 00:40
By what do you mean the door is lagging ?

The sound is too short and the door opens too slow ?
Either lenghen te sound, or make the door open faster.

Login to post a reply

Server time is: 2024-09-23 10:19:03
Your offset time is: 2024-09-23 10:19:03