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 / shooting what you want to shoot

Author
Message
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 9th Nov 2003 19:49 Edited at: 9th Nov 2003 19:53
Hi all, i'm trying to make a fixed posistion fps bottle shoooting game controlling the cross hair with the mouse.
This is what i've got so far


I don't know how to make it so that when the mouse button is clicked AND the crosshair is ANYWHERE over one of the bottles that bottle will disapear. I know i have to use the mouse click()=1 to check if the button is clicked. Thanks

"I SEE" said the blind man
Neil19533
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: England
Posted: 9th Nov 2003 21:59
some code:

hide mouse
cls
`draw crosshair
load image "cross.bmp",1
`draw bottles
load image "bottle.bmp",2
sprite 2,XValue,YValue,2
do
sprite 1,mousex(),mousey(),1
if sprite collision(1,2)
hide sprite 2
endif
loop
Neil19533
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: England
Posted: 9th Nov 2003 22:00
damm forgot the mouse click
code:
hide mouse
cls
`draw crosshair
load image "cross.bmp",1
`draw bottles
load image "bottle.bmp",2
sprite 2,XValue,YValue,2
do
sprite 1,mousex(),mousey(),1
if sprite collision(1,2)
if mouseclick()=1
hide sprite 2
endif
endif
loop
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 9th Nov 2003 22:20 Edited at: 9th Nov 2003 22:52
Thanks. This does work but only with the first bottle of the line. I tried swapping the 2 for n but that says error at line whatever Bob does not exist. Any tips.

"I SEE" said the blind man
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 9th Nov 2003 22:59
from anyone

"I SEE" said the blind man
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 9th Nov 2003 23:10
Quote: "error at line whatever "


The line # and the line may help

Got a knack for finding secrets??? Jingot Racing---A new brand of Racing---Only from Nightwatch Studios
"hey, it's tomorrow" - Hamish
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 10th Nov 2003 18:31 Edited at: 10th Nov 2003 18:32
the line that I put IF SPRITE COLLISION (1,N)on

"I SEE" said the blind man
Neil19533
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: England
Posted: 10th Nov 2003 19:17
This code works alss you have to do is add some sound or some explosion effect
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 10th Nov 2003 22:20 Edited at: 10th Nov 2003 22:37
Thanks.Does this meen it wouldn't work if I drew my own backgroung and used it as a sprite that covered the whole back of the screen because the cursor would always be colliding with it.

"I SEE" said the blind man
Neil19533
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: England
Posted: 11th Nov 2003 00:58
you could do a background but you would have to change it a bit so no object above a certain number can be shot
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 11th Nov 2003 19:21
Thanks to everyone for their help.Now on with the game.

"I SEE" said the blind man

Login to post a reply

Server time is: 2024-09-21 09:33:59
Your offset time is: 2024-09-21 09:33:59