Contact between characters beyond IsCollidingWithChar

Started by JimmyD, Thu 02/10/2008 21:09:13

Previous topic - Next topic

JimmyD

HAd a search, but couldn't find anything relating to this, I was just wondering...

If I have two characters, Ego and Man. When Man walks into Ego, they don't stop until Ego's position on the floor is the same as Man's. Rather than having things happen when their position on the "floor" meets each other, can I make the game produce a reaction when their sprites touch? That is, any part, instead of just their bases on the floor.

Thanks in advance!

Akatosh

I believe you're looking for the AreThingsOverlapping function.

Dualnames

Or you can use this:
repeatedly_execute() {
if (cEgo.IsCollidingWithChar(cMan)==true) {
//reaction here
}
}

I'm using a similar thing on HHGTG and it works the same, can't really be sure about overlapping but if akatosh says so I can't really disagree.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Khris

QuoteContact between characters beyond IsCollidingWithChar

...

There's a Pixel-perfect collision detection module.
(AreThingsOverlapping tests the bounding rectangles, not the sprites themselves.)

JimmyD

Quote from: KhrisMUC on Fri 03/10/2008 11:25:34
QuoteContact between characters beyond IsCollidingWithChar

...

There's a Pixel-perfect collision detection module.
(AreThingsOverlapping tests the bounding rectangles, not the sprites themselves.)

Ah! Thank you, this is the kind of thing I'm trying to do. I'll see about getting it implemented.

SMF spam blocked by CleanTalk