Curious about a method
I know how to create spawn points and make an actor choose one of them randomly when spawning. I'm wondering about another method, if it would work I should say.
Let's say you have a maze made out of wall actors and you want to spawn an object anywhere in the maze, but not on top of a wall actor.
Spawn actor in random x, random y location
Check if actor overlaps wall actor
If yes, delete actor and try spawning again
If no, done spawning
Though simple enough written is pseudo code, I can't seem to get gamesalad to do this. I can't find a "loop" type of behavior.
Let's say you have a maze made out of wall actors and you want to spawn an object anywhere in the maze, but not on top of a wall actor.
Spawn actor in random x, random y location
Check if actor overlaps wall actor
If yes, delete actor and try spawning again
If no, done spawning
Though simple enough written is pseudo code, I can't seem to get gamesalad to do this. I can't find a "loop" type of behavior.
Comments
To do what you are saying so it spawns randomly somewhere in the maze, you would just need an attribute that turns on and off depending on the actors collision with the walls. If it's true, then interpolate to another random position. I don't know how well that will work since theoretically, you could be waiting for 10 seconds before it spawns in an open location.
Being a mechanical designer, I use Solidworks extensively to do my design work. What Solidworks does is dynamically display the X,Y coordinates of your mouse pointer position in the bottom middle right of the screen. It would be wonderful if GameSalad had a similar display for getting coordinate position when you want it. Also a grid that you could set the size of as well as position and be able to display it and turn snapping on and off .
Lon
As far as grids go, I don't know if you are familiar with Deep Blue's grid program. It doesn't have a snap function, but it will work with any program since it's an overlay, and you can customize it as well.
http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./Screen_Grid.html
Darren.