How to create a unlimited actor?

lucasfl

  • Posts: 11
Continuing my previous question "How to do an auto-move actor?", how can I make the actor , that auto-moves vertically, be unlimited? I need to put one by one the actor?

Thanks!!

Epic428

  • Posts: 1118
Well continuing on with your raindrops. I'd suggest creating a scene behavior, then have that scene behavior create a recycled actor (the rain drop) at random intervals and random locations at the top of the screen.

Then attach the auto move behavior to the actor and add a check in the Always section of that behavior to see if the rain drop has fallen below a certain height or off screen, if so, then recycle the actor.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

lucasfl

  • Posts: 11
I understand, but in the recycle I need to determine the position of x and y. How can I make it random?

riotmedic

  • Posts: 17
Number & Text > Random Numbers options in your behavior.
I'd get a random number within the size of your scene.

It might be safer to make a .gif of a rainscene and overlay it using the foreground, just so there's less computational requirements. Unless you're dodging these raindrops...

Epic428

  • Posts: 1118
to make the position random, you need to use this block.



I would place the block right in the x value of the create recycled actor block. This way you determine a random horizontal position and keep the vertical constant.

Edit :ninja'd
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

lucasfl

  • Posts: 11
Thank you very much Epic428 and Riotmedic  8)