Spawning Actors..
AdnanH
Member Posts: 77
in Help Wanted
Just need help how can i spawn actors along the top of my screen in random positions? i have it set up and my actor falls down the middle of the screen all the time but i want it in random positions along the top and not always in the middle as the app im currently working on would be far to easy then..
can someone just give a quick tip on how i can spawn actors along the top in random positions is the question in short?:D
Comments
In the spawn behavior, set the positions to x=random(0,320) and y=568 where 320 is the width of the scene and 568 is the height (your actual values may be different). Make sure the positions are relative to scene, not actor.
You'll need to adjust those values if you don't want actors spawning right on the edge of the scene (with half of the actor showing). You can do this with x=random(0+actor_width/2,320-actor_width/2) for example.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks alot mate got it all fixed up!!:)