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

Legacy GM [SOLVED] An object checks if another object is in the view

R

ruwcom

Guest
So I have a wall that prevents the player to move forward until there are no enemies on the view, I though the easiest way was to check just that and then destroy itself, but the code needs to run in the wall object, how can I do that? collisions don't seem to work.
Also It can't be !instance_exist because there would be more enemy objects, but outside of the current view.
 

FrostyCat

Redemption Seeker
Code:
if (collision_rectangle(view_xview[0], view_yview[0], view_xview[0]+view_wview[0], view_yview[0]+view_hview[0], obj_enemy, false, false) == noone) {
  instance_destroy();
}
 
Top