Page 1 of 1

How do I spawn objects within the player screen?

PostPosted: Thu Jun 29, 2017 8:29 pm
by LudvigMarten
Trying to make a rain effect, but I don't want to create the raindrops all over the layout since that would lag the game. Instead I want the raindrops to spawn within the player screen. How do I do this?

Thank you.

Re: How do I spawn objects within the player screen?

PostPosted: Thu Jun 29, 2017 9:21 pm
by PaulFortune
There's a few ways you could do this. I am assuming you would like to spawn the raindrops only from the top of the screen which would mean getting the screen's coordinates.

Are you planning on using sprites for the raindrops? Also, do you want the raindrops to have a random pattern for when they are spawned (so that they have a random X position when they are created)?

Re: How do I spawn objects within the player screen?

PostPosted: Thu Jun 29, 2017 9:31 pm
by LudvigMarten
Yes, on top of the screen, sprites as raindrops and a random spawning pattern would be great. Thanks for helping me out!

Re: How do I spawn objects within the player screen?

PostPosted: Thu Jun 29, 2017 9:43 pm
by PaulFortune
Ok, I had a capx that achieved something similar to this I'll try and find it right now.

Re: How do I spawn objects within the player screen?

PostPosted: Thu Jun 29, 2017 10:13 pm
by PaulFortune
https://www.dropbox.com/s/q7d8ffmw6expt1p/rainexample.capx?dl=0

Ok, I modified a capx I had to make it more like what you were asking for. Let me know if anything goes wrong.

Re: How do I spawn objects within the player screen?

PostPosted: Thu Jun 29, 2017 10:18 pm
by LudvigMarten
Thank you so much, that's exactly how I wanted it! You're a legend for helping me out!