This is a simplified version of the collision code currently being used by my Evoeon 2D Game Builder. The script allows you to create, position and size 2D collision blocks on the screen. The player panel and other panels can interact with these blocks to create collision boundaries.

I am still exploring more options to create a better 2D collision system, but for now, here is the original code.
2D Collision Block Code