Hime-Works / Requests

Bug reports and requests that may require longer discussions and is not suitable to leave on the blog
http://himeworks.com/
GNU General Public License v2.0
7 stars 9 forks source link

Image PIxel Collision #47

Open HimeWorks opened 10 years ago

HimeWorks commented 10 years ago

There's this script written by Cidiomar a long time ago that provides pixel collision functionality between characters (player, event, followers) and also with pictures.

http://himeworks.com/redirect.php?type=demo&name=image_collision_detection

They are mostly helper functions, with a couple script calls for eventing purposes. I don't have the source code for the DLL though.

DemosKerrigan commented 10 years ago

Does it act like sight detection (being spotted at distance by a guard) or something like : The player is next to the event and the player presses the directionnal button leading towards that event (like going trhough, prompting it to react)?

HimeWorks commented 10 years ago

It is literally just checking if two sprites overlap each other. It even checks non-rectangular shapes, so for example if you have a kitty with a long tail and the tail is moving up and down, your actor will only get hit if the tail actually touches you.

DemosKerrigan commented 10 years ago

Now I get it, that's the thing we see in most plateform games to check if you touched the enemy or not to get damage or other effect. I wonder why I didn't think about it in the first place. How silly of myself ^^"

Thank you very much for the detailed explaination. ^^

cidiomar-jr commented 10 years ago

Is this really being used by anyone? I can try to find the DLL`s source code if so.

HimeWorks commented 10 years ago

I'd be interested in seeing the source code at the very least, since I haven't had much luck getting an efficient pixel collision check for irregular shapes.