{SOLVED}Create actor in region

thor6577

  • Posts: 189
Ok hey guys Im making a game where you have to dodge some items falling from the sky, but i can't figure out how to make a behavior that creates the falling actor in a region. Here is what i have so far.
___EDIT___
Don't pay attention to the random block over always block. Accidently left it .  :o

« Last Edit: November 11, 2011, 03:48:24 pm by thor6577 »

kehwar

  • Posts: 75
that goes in the "always" not in the "created", i added offsets to the x and y positions to avoid actors outside the scene... if your game will have things falling, then the "y" might need to be negative (make actor appear outside scene)

items outside scene are not animated by default, add a "always simulate" somewhere in the behavior for the falling items

« Last Edit: November 10, 2011, 07:18:46 pm by kehwar »

coleislazy

  • *
  • Posts: 2607
That basically looks like it will do what you're trying to do. You may want to change the Y value, though. Otherwise the actor may spawn near the bottom of the screen. Also, every once in a while, an actor may spawn on the very right edge of the screen and be mostly off-screen. You could subtract the width of the actor you're spawning from the screen width to prevent that.

coleislazy

  • *
  • Posts: 2607
that goes in the "always" not in the "created"

If it is in "always", it will spawn many timedTasks each second. It should be where it is now, in "when created".

thor6577

  • Posts: 189
That basically looks like it will do what you're trying to do. You may want to change the Y value, though. Otherwise the actor may spawn near the bottom of the screen. Also, every once in a while, an actor may spawn on the very right edge of the screen and be mostly off-screen. You could subtract the width of the actor you're spawning from the screen width to prevent that.
Ooh thanks man it worked. BTW what i was trying to do is make a rain like effect TY guys ill post the rain actor on the forge soon!