This content has been marked as final. Show 5 replies
When duplicating multiple movie clips, at what point (number of duplications) does the player start to bog down... 100... 1000?
#1 Depends on your computer, on mine, it can handle up to around 1000. I made fire before.
#2 Why do you need 1000 leaves? As soon as the leaf leaves the screen, remove it.
The code that would 100% remove it after it gets off the right side of the screen is:
Hope this helps.
Thanks, it helps a bit. The leaves are not leaving (no pun intended) the screen. They remain on a stationary tree... it's the wind that "moves" across the screen. I know in 3D applications, one could use particles are something simliar to achieve natural controlled-chaos. I suppose it would take some time and experimentation to code something similar... and someone who knows what they are doing (unlike myself). ;-)
If you want it to leave on a tree, why not make it when wind comes in with a strength of X (maximum of 10, lets say)
Make all the leaves turn (the leaves are initially facing down, so they are initially at 180 degrees)
And then, make the tree bend a little and make the leaves
_root.windStrength=random(11) //number between 0-10, including 0 and 10
_x+=_root.windStrength*3 //makes the leaf move 3*the wind strength, you can make it +random(10) to make it look more real
_rotation+=(_rotation-(90+_root.windStrength*9))/5 //makes the wind rotate a towards 90 degrees when the wind is 10 and 100 when wind is 9, etc, etc. Makes it look like the wind is pushing it
The leaves stay on the tree, and you can make the wind come in every now and then.
Hope this helps, if not, I'll be back xD!
Cool, that will get me started. I am going to play around with what you suggested but in addition to that, I'm going to set it up so that the leaves on the left-hand side of the tree begin moving prior to the right... assuming the wind blows from left to right. But also, that random option is necessary so that it looks more realistic.
Thanks, I'll post what I've come up with for review. Give me some time though as I'm fitting this project in as I have time for it. :-)
Ok, I'm back after being sidetracked with other projects for awhile. I've started trying to work this out by doing a lot of research. This whole "learning to be a programmer" thing is tougher than I imagined yet somehow easier too. Anyway, I digress..
I may be traveling down the wrong path again but I am creating two classes now. One class for the wind and one for the leaf. Does this sound like the right direction? I am giving the wind class properties like speed, strength and the leaf class properties like rotation, position, size, etc.
By doing this, can't I create a function that generates (virtual) random wind bursts that effects the leaves as it "travels" across them? Or am I overthinking this issue like I'm so prone to do?
Thanks guys, I know I lean on you a lot for direction. It's the "thinking like a programmer" skill that I think I need to develop the most.