Asset - Scripts Top-Down Movement & Collision - Object Based Collision System with Single Script Implementation for GMS1 & 2

1588098598801.png
There's an in-browser playable demo that supports Keyboard and Controller input for testing purposes.

This asset has been out on the YoYo marketplace for a LONG time now, but I just recently created a new update that has better support for walls of all angles (rather than just 45 degree walls) as well as features like corner slipping. The script itself is fairly straight forward, but the example project is very robust with examples demonstrating the most basic implementation (press a direction and move) and advanced (analog inputs with momentum and friction).

That update isn't actually available on the Yoyo Marketplace due to the current marketplace issues, but it will be updated as soon as Yoyo gets their crap sorted. In the meantime, check it out over on Itch! If you are one of the almost 500 people who have already purchased the earlier version on the Yoyo Marketplace and want to check out the update, just send me a DM here and I'll either send you the YYZ or give you a download key for the version currently available over on Itch.

If you have any questions, feel free to post them here!
 

atmobeat

Member
EDIT: the solution to my concern is that yes both the calling instance and the obj_checker need "precise per frame" selected but the calling instance can (and I assume usually will need to) use a different sprite for its collision mask. That mask can be any shape you want it to be. I'm a noob!

Hi PixelatedPope,

I posted this on the itch.io page and here as well but I thought you might not see my questions on Nocturne's thread and maybe you'll get it sooner here than on the itch.io page.

First, thanks for all you do for the GM community. Can you help me with something I don't quite understand with this method (which looks awesome btw)? In tile_meeting_precise you use place_meeting with precise collision checking selected for the obj_tile_wall collision type. First question: to use precise collision checking, both the obj_tile_wall and the calling instance have to have precise selected under the type of collision mask, right? That's what the manual says for place_meeting (http://127.0.0.1:51291/index.htm#t=...rhsearch=place_meeting&rhhlterm=place_meeting).

That should make the collision mask identical to the shape of the sprite, right? If that's right, how did you get the collision mask in the example game on the TDMC itch.io page to not include the sprite's hair? Are there two objects (the character and the green box) that move together with only one (the green box) checking for precise collisions? This is obviously important for our favorite genre of game (2.5d top-down) as you don't want the character's head running into wall above him which would undermine the fake 3d look. I don't see how this problem is solved just given the code posted on the yoyoblog and itch.io.
 
Last edited:
Answered over on itch.
But here's a copy-paste:

The player object has "collision mask" assigned to it. This is set in the object panel just below where you assign the sprite.
The object will use the assigned sprite's mask for all collision checks. You can also do this yourself by setting the "mask_index" variable to any sprite.
In the draw event I then draw the mask index with draw_sprite(mask_index,0,x,y) at a 50% alpha and then draw the normal character sprite on top. This way I know the mask is lined up and positioned to the character as I expect.
 
Top