GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Spawning Actors..

AdnanHAdnanH Posts: 77Member

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

  • tatiangtatiang Posts: 11,751Member, Sous Chef, PRO, Senior Sous-Chef

    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

  • AdnanHAdnanH Posts: 77Member

    Thanks alot mate got it all fixed up!!:)

Sign In or Register to comment.