• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[Solved] Collision Mask Acting Weirdly

I

ImBored

Guest
I am having an issue with my collision masks. Everything was working fine until I added code to make the game scale based on the screens resolution.

I have a post-draw event that has the following code:
Code:
draw_surface_ext(application_surface, XOffset, YOffset, Mult, Mult, 0, c_white, 1);
I'm showing this because I feel like it is something to do with the way gamemaker scales objects.

I have a grid of objects. My collision code is in the step event and is:
Code:
if (position_meeting(mouse_x, mouse_y, self))
The problem is that the collision masks are seemingly enlarged but slowly get smaller until the center object in the grid. The center objects mask is working perfectly but all the rest are enlarged for some reason. In the image, the red square is the object that is "colliding" with the mouse.
Screenshot (2).png

Edit:
I have done some more testing and found that it probably has something to do with drawing the application surface.

The next picture shows what happens if I draw squares around the bounding boxes using the following code:
Code:
 draw_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom)
The orange squares are being drawn where they should be but it isn't where the actual collision ends up taking place so something must be happening before I draw or my application surface is moving when being drawn but my collision masks aren't. The orange squares just show the boundaries of the collision masks, I'm using a sprite that is a rectangle shape similar to the actual grid shapes and so it is at an angle. It is also set to precise.
 

Attachments

Last edited by a moderator:
Top