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 / Pong collision and sound file help

Author
Message
Jon The Fabulous
17
Years of Service
User Offline
Joined: 15th Jan 2007
Location:
Posted: 15th Jan 2007 16:54
Hi all

I have recently bought darkbasic pro and have made a pong game.
I can get music to run in the background fine but what i want to do is have a blip noise happen every time the ball hits one of the paddles

Currently the noise plays at the start of the game and then never again.

Can anyone help?
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 15th Jan 2007 20:53
can we see your code?

put them in the code boxes


BM

Our aim is to keep the loo's clean, your aim can help.

Dexter_
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location:
Posted: 15th Jan 2007 21:20
you said that it only plays the noise at the start of the game...
maybe you need to put an:

'if (collision between ball and paddle)=1
then (play the sound)'

in your loop, so it can continually run
im not really sure, but i hope it helps
Jon The Fabulous
17
Years of Service
User Offline
Joined: 15th Jan 2007
Location:
Posted: 16th Jan 2007 11:34
k here is the code i have:



As you can see i tried an if statement for the play sound.

Also tried
if (collision statement) then Hit#=1

if Hit#=1 then play sound

but had same results.
Jon The Fabulous
17
Years of Service
User Offline
Joined: 15th Jan 2007
Location:
Posted: 17th Jan 2007 14:04
Fixed it Hurrah

The code worked but only when the ball was colliding with the top of the paddles. Changed some of the area sizes and its all good. Now just have to sort out the loading screens,menu screens and sort out some texturing and all is groovy with the world.

Login to post a reply

Server time is: 2024-11-26 23:37:07
Your offset time is: 2024-11-26 23:37:07