Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Image PIxel Collision #47
Comments
|
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)? |
|
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. |
|
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. ^^ |
|
Is this really being used by anyone? I can try to find the DLL`s source code if so. |
|
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. |
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.