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 / What`s the difference between sprite hit() and sprite collision() ?

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Jul 2008 22:31
This might be a newbie question, but here we go:

What`s the difference between sprite hit() and sprite collision() ?

Can someone please quickly explain, because they seem to do the same thing...

thanks, TheComet

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 26th Jul 2008 22:36
Sprite Collision() constantly returns 1 if two sprites are overlapping.
Sprite Hit() will only return 1 once every time two sprites touch and then it will reset to 0.


Thank you for your time.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Jul 2008 23:16
Ahh! Thank you NanoGamez Guy!

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
sinisterstuf
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: Namibia, Southern Africa
Posted: 10th Aug 2008 13:19
Oh, I didn't know about the resetting... I just though the collision was for when they overlap and the hit was for when they touch... Oh well. So does that mean if you're using spritehit() for two sprites and they touch then it returns 1 then 0 and they keep touching but it keeps returning 0 until they stop touching and then touch again or what? This resetting thing doesn't make sense to me.

over and out
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 10th Aug 2008 20:49
Quote: "So does that mean if you're using spritehit() for two sprites and they touch then it returns 1 then 0 and they keep touching but it keeps returning 0 until they stop touching and then touch again"


Yes it does.


On the other hand, you have different fingers.

Login to post a reply

Server time is: 2025-06-07 06:36:35
Your offset time is: 2025-06-07 06:36:35