• 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!

Help with moving a group of objects together.

Hello everybody, hope all is well!

I'm a novice at GML and I have no clue how to go about programming a solution to create this game mechanic.
I've got a couple small groups of randomly generated tiles from a top down perspective game. What I am wanting
to do is check if a global variable is activated, and if so move the entire group of tiles down at the same "speed"
until they collide with another group. ( See example gif bellow )




ezgif-4-d593bc374d0e.gif
If anything is unclear or you have any more questions just let me. Thanks in advance for your help and for stopping by.

Thank you for your time!
 
More details that might help: Objects will only move in one direction
Objects need to be independent for more interaction after moving
It would be a plus if the player walking in the path of the group would not stop it but not needed
 
What you want is basically Tetris code! Check out this old blog post from @YellowAfterlife : https://yal.cc/gamemaker-tetris-in-full-drag-n-drop/

It uses old (1.4) DnD, but the concepts are well explained and it shouldn't be too hard to implement in your own project, whether as code or DnD.
Sweet, that's actually hilariously enough something I should have thought of looking up! I still use 1.4 a ton and have a DnD converter for that version as well. Will have to tinker around with it. When I find a conclusion I'll post my ghetto code up in case others want the same result!

Thanks Nocturne!
 
Top