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 / sprite collision (2D)

Author
Message
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 13:05
I am make a simple space invaders game but I can't get my enemy sprite to disapear when my bullet hits it please help.
here is the code
I needed somewear to start.

********
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 14:18
I want sprite 2 my bullet to destroy the red square but I can't get the sprite collision or sprite hit to work please help. source code would be help full (using my code if possible)
THANKS!!!!!

********
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Dec 2003 14:26
i think you need: "Sprite Collision"

If sprite collision(bullet,enemy)=1 then delete enemy

replace the bullet and enemy with the sprite number that they are


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 14:48
thanks but it says rubtime error at line 32 sprite does not exist which is where I placed it?
PLEASE HELP??????

********
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 14:50
or MSN me at jasonl220@hotmail.com

********
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 26th Dec 2003 15:27
if sprite collision(1,2) then text 100,100,"ITS A HIT!!!"

stick that in your do..loop, it should respond when object 1 hits object 2, if it doesn`t work then let us know.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800 128mb.
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 15:32
Don't work says "Runtime error 302. can't find sprite on line 32" line 32 first line of main loop.

********
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 26th Dec 2003 17:56
If you are checking the collision every loop then sometimes the bullet sprite won't be there and sometimes the enemy sprite won't be there.
Something like this should work

if sprite exist(bullet) and sprite exist(enemy)
If sprite collision(bullet,enemy)=1 then delete sprite enemy
endif

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 19:43
[b][u][center]THANKS ALLOT!!!!!!!

********
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 20:38
when I press spacebar a bullet travels across the screen but if I press spacebar again when the bullet is half way up the screen it disapears and reapears at the bottom how do I stop this?
here is my code

********
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 21:06
also how do i display a integer value using the text command? e.g. score : integer value

********
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 21:13
when i use the text command to display text in the top corner nothing appears, how do I make i show?

********
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 26th Dec 2003 22:38
The text command only accepts strings so if you want to display an integer you would use str$(int) to convert it to a string,
text 0,0,"score : "+str$(integer value)

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Dec 2003 23:25
but my text doesn't show on the screen (I've got a basic space invaders game and i just want to add the score but it doesn't show the text

********

Login to post a reply

Server time is: 2024-09-21 14:51:48
Your offset time is: 2024-09-21 14:51:48