Phileas's Pictures Collision

Plugin name: Phileas's Pictures Collision

Author: Phileas

Version: 1.1.1 for MZ

Release date:
1.0.0 - 10.March.2024
1.1.1 - 14.June.2025

Plugin description:
Allows you to determine if 2 pictures intersect.
It will help in mini-games and game mechanics based on collisions.
Use the plugin command - "Check the collision".
Specify the ID of the pictures and the switch to which the result will be set.

How it looks like:
2024-03-11_23-48-00.png


Code

License

This plugin is released under MIT license.
This means that you can freely use the plugin in non-commercial and commercial games and even edit it.
But be sure to include me in the credits!

Compatibility:
If there are any problems, write to me.
1.1.0
Added a collision check with ignoring transparent pixels.
1.1.0
Added a collision check with ignoring transparent pixels.
Awesome work - I'd like to include one of your functions in one of my setups and would be happy to credit you (for MV since that is what I am using)

I've been digging through sprite/bitmap/etc and I'm still learning a lot about the imageData and was thinking "would it be possible to have it not just check the bounds of a sprite but the actual pixel data to see if there is a collision between that."

Lo and behold, you are already there with this update haha.

I was just thinking through collisions between pictures (or really any sprite for that matter added to the scene) and came up with some basic PIXI aabb checks.


Thanks again and keep up the good work!
Awesome work
Thank you!
I'd like to include one of your functions in one of my setups and would be happy to credit you (for MV since that is what I am using)
Yeah, sure.
However, I did not understand well what you mean by "setup") Plugin, demo, project?
Thank you!

Yeah, sure.
However, I did not understand well what you mean by "setup") Plugin, demo, project?
Sorry, this plugin is for MZ and it doesn't immediately work for MV out of the box. Also, the function I needed was specifically for bitmaps so that is the function I am currently borrowing (with credit to you, of course). I just edited some variables to help me understand the code a bit better.

This is just a project where I test various things and work through JS and RPG Maker. Maybe when I get a good prototype I'll release something but for now I am mostly learning by creating one map that shows game mechanics, mapping, etc.
1.1.1
Optimized pixel-by-pixel collision calculation.
1.1.1
Optimized pixel-by-pixel collision calculation.
Nice - I clocked the previous version between 3 and 6ms just two simple pictures.

This version is consistently between 0.1ms and 0.7ms on various tests between pixel collisions and is very similar in performance with the basic PIXI bounds (rectangle) collision test (between 0ms and 0.5ms). Haven't done any stress testing, though.
Hey man, been looking for a plugin like this for a long time, but I can't seem to get it to work. I don't know if this thread is still alive, but I'm shooting my shot.

I've got a little system going in my project where I'm trying to utilize the picture collision; however, whenever my parallel common event runs the plugin command, the switch isn't flipped. The pictures overlap and the assigned picture ID's are all in check.

I thought I had it working for a short while, but that was before MZ's latest update. You think it might've broke from the update?
@Spinko, hi! All my threads are alive)

I know that several of my plugins have already stopped working after the last MZ Core update. I'm currently heavily loaded with other things, and as soon as I'm free, I'll publish the plugin fixes.
@Spinko, hi! All my threads are alive)

I know that several of my plugins have already stopped working after the last MZ Core update. I'm currently heavily loaded with other things, and as soon as I'm free, I'll publish the plugin fixes.
Oh, don't let me pressure you, haha! Just happy to see these plugins getting the love they deserve. Love your work, hope to see more. 😀

Original thread: https://forums.rpgmakerweb.com/threads/phileass-pictures-collision.166705/