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

GameMaker Collision objects limitations?

If it's not in GMS2, there is a manual solution to the problem:
Code:
var list = ds_list_create(); // Create a temporary list for the instances at the location
var inst = instance_place(x,y,object); // Get the first instance in the location
while (inst != noone) { // As long as there is an instance at this location, perform the loop code
   ds_list_add(list,inst); // Add the instance to the list
   inst.x += 1000; // Move the instance
   inst = instance_place(x,y,object); // Check if there is another instance at the original location
}
var list_size = ds_list_size(list); // Get the how many instances where found (which is equivalent to the list size)
for (var i=0;i<list_size;i++) {
   with (list[| i]) { // Using the ID's that we previously stored in the list
      x -= 1000;  // We move them all back to where they were
      // Do any manipulation/checks you want to happen to specific instances here
   }
}
ds_list_destroy(list); // After that, make sure to destroy your list so you don't have a memory leak
 
Top