Chara
Member
I made an object that produces particles, and to make things simpler for myself I attempted to make an object that automatically places these emitters anywhere where there aren't walls
The code I'm using is as follows (in alarm 0):
The create event just sets the object's coordinates to be 0, 0 and activates alarm 0, alarm 1 only activates alarm 0. obj_floor is the emitter
After some testing I've determined that there must be something wrong with place_meeting, because it just places the emitter in every available space regardless of if an obj_wall is present there or not
Any idea what I'm doing wrong?
The code I'm using is as follows (in alarm 0):
GML:
if(!place_meeting(x,y,obj_wall)){instance_create(x,y,obj_floor)}
x+=20
if(x>room_width){y+=20;x=0}
if(y>room_height){instance_destroy(self)}
alarm[1]=1
After some testing I've determined that there must be something wrong with place_meeting, because it just places the emitter in every available space regardless of if an obj_wall is present there or not
Any idea what I'm doing wrong?