O
ofekgani
Guest
In the game when I hit some object so it replaces random position properly.
This is the code I used:
=================================================================
spawn_id= instance_create(0,0,obj_hero);
do
{
spawn_id.x = random(room_width);
spawn_id.y = random(room_height);
with(spawn_id)
{
collision = place_meeting(x,y,obj_wall)
}
}
until spawn_id.collision = 0
=================================================================
My problem it's settled on a particular object.
A section of code:
==============================
with(spawn_id)
{
collision = place_meeting(x,y,obj_wall)
}
}
until spawn_id.collision = 0
=============================
This prevents the object to the specified object get settled into a place
But I want to prevent the object to other objects and get settled into a place only for one object
How do I do it with code?
This is the code I used:
=================================================================
spawn_id= instance_create(0,0,obj_hero);
do
{
spawn_id.x = random(room_width);
spawn_id.y = random(room_height);
with(spawn_id)
{
collision = place_meeting(x,y,obj_wall)
}
}
until spawn_id.collision = 0
=================================================================
My problem it's settled on a particular object.
A section of code:
==============================
with(spawn_id)
{
collision = place_meeting(x,y,obj_wall)
}
}
until spawn_id.collision = 0
=============================
This prevents the object to the specified object get settled into a place
But I want to prevent the object to other objects and get settled into a place only for one object
How do I do it with code?