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 / Trouble having 2 animated sprites detecting collision

Author
Message
Zeus6191
14
Years of Service
User Offline
Joined: 24th Oct 2011
Location:
Posted: 5th Dec 2011 06:54
I'm making a 2d fighting. I'm trying to make the sprite attacking detect collision with the one that is idle, but still animating. I've tried detecting collision in multiple sections of the code, but I can't seem to detect any type of collision between my two sprites.

Although I'm drawing the sprite with paste image, the SPRITES are actually behind them, but hidden so i Know that isn't the problem/

Even asking if the sprite detects collision during any one of his animations with the other sprite during anyone of his respective animations there is still no collision.

Here is my code, the collision detection takes place under the collision gosub and under the attack animation under gosub Anim.

Anybody have any suggestions?



---------------------
What the h4x...
Lucas Tiridath
AGK Developer
17
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 5th Dec 2011 17:01
Hi there. I've not gone through all your code in detail but one thing that I notice is that about three of your sprite collision detections look like this:



Now obviously that's never going to be true because the two parameter version of this command only return 0 for false and 1 for true so it will never be greater than 1.

I'm pretty sure the animation shouldn't make any difference because the sprite collision command simply does box collision. Hope that helps. Good luck fixing it.

Login to post a reply

Server time is: 2026-07-11 22:25:31
Your offset time is: 2026-07-11 22:25:31