K
kirkkaf13
Guest
Hi everyone,
I recently purchased GMS;Professional after not using the software since the early version 4 back in 2001 and wow has the software developed into something special!
I have a fair bit of experience programming in Java creating android applications for medical devices at a small firm so I am familiar with the concepts. Although I am having some trouble with a small script to generate my level.
I have a script that generates various objects in the world during startup this works fine. The trouble was they were sometimes being created too close to each other. I tried to avoid this by checking the distance of the objects during creation using the distance_to_object but now my game window doesn't appear.
First I thought this could be a performance hit as it couldn't find a suitable location far enough away from other objects which caused it keep looping. After generating less objects and changing the allowed distance it still didn't show the game window. Removing this small check and the window does appear again.
Hope this makes sense, any ideas?
Kirk
I recently purchased GMS;Professional after not using the software since the early version 4 back in 2001 and wow has the software developed into something special!
I have a fair bit of experience programming in Java creating android applications for medical devices at a small firm so I am familiar with the concepts. Although I am having some trouble with a small script to generate my level.
I have a script that generates various objects in the world during startup this works fine. The trouble was they were sometimes being created too close to each other. I tried to avoid this by checking the distance of the objects during creation using the distance_to_object but now my game window doesn't appear.
First I thought this could be a performance hit as it couldn't find a suitable location far enough away from other objects which caused it keep looping. After generating less objects and changing the allowed distance it still didn't show the game window. Removing this small check and the window does appear again.
Code:
while (distance_to_object(obj_wall < 30))
{
x = random(room_width);
y = random(room_height);
}
Kirk