Hi all,
having a question concerning "on start of layout"....
At the start of a new Level, I'd like to put some objects at random locations on the layout, like crates or other obstacles (for some kind of top down shooter game).
- objects should be picked from a range of suitable objects.
- objects should have a random rotation, probably slightly variations of size.
- objects should have a certain distance to each other, to make sure that they can't form unreachable areas. (Probably using collision detection to check?)
- if this would be visible for the user (maybe it takes some time, like half a second or so), it would be good to hide the process somehow.
So far, I'm able to set one kind of objects at random locations, with "on start of layout" and a for loop, and give them a random rotation. However, the objects overlap, and when I try to check for collisions to destroy the overlapping ones, they all vanish. It only works if I pick one of these objects randomly (not on start of layout, but every frame) and check for collisions, but that's not a good way to do things, I guess...
can somebody please give me a hint how to do this at layout start?