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 Professional Discussion / Problem with sprite hit...

Author
Message
Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 5th Jul 2010 18:11
For some reason sprite 2 is not picking up when it hits sprite 1...

Here is my code,



What am I doing wrong?

I've attached one image (sprite 1) and the next one will be attached in the post below this one.

Thanks!
Zeus

Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 5th Jul 2010 18:11
Sprite 2

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jul 2010 18:53 Edited at: 5th Jul 2010 18:57
sprite hit() will only return a "1" once every time the sprites collide. So lets say you are moving the sprites towards each other, there will be a loop where the sprites eventually collide. Only for this loop will the command sprite hit() return a 1. The next loop it will return a 0, until you pull the sprites apart and collide them again.

The command you might be looking for is sprite collision()?

EDIT : just ran your code, I found that sprite hit() and sprite collision() are not pixel perfect collision... Is that what you happen to be looking for?

TheComet

Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 6th Jul 2010 00:21
That is exactly what I am looking for.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jul 2010 01:36 Edited at: 6th Jul 2010 01:38
Ok well I found this in the code base:



And this is the snippet from cloggy:



I seem to recall there being a dll for this, but I couldn't find it... TGC's search engine sucks, they can't try different combinations of words. If I enter "pixel collision dll", it will ONLY search for things with "pixel collision dll" in it, but won't try "collision pixel dll" or "collision dll for pixel". What were they even thinking? Even an ape would have thought of different combinations...

[/rant]

Sorry if I offended anyone, I didn't mean it

Good luck!

TheComet

Zeus
20
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 6th Jul 2010 17:29
Thank you so much!

Login to post a reply

Server time is: 2026-07-25 08:13:14
Your offset time is: 2026-07-25 08:13:14