how to make items fall from the top of a screen
taytay10
Member Posts: 66
Hello I have a question. How would I make a image fall from the top of the screen and disappear when it hits the bottom of the screen? Also would i be able to hide images behind another image (ie. a cloud) and then have the the image of raindrops fall after they reach the bottom on the cloud? If you know how to do this it would be greatly apreciated. Thanks in Advance!
Comments
Sorry if that doesn't make sense i'm not the best at explaining things.
Edit: You can make actors invisible so they can hide anywhere.
Eight Bit Remix
Check out this video on recycling actors:
You could easily have a rule that tells the raindrops, when they reach a particular Y level on the screen, to change their alpha from 0 to 1, and when they hit a second Y (probably set to 0 or -1) on the screen, change their position to be back at the top again.
To be more clear:
Place your raindrop actors behind your cloud or above the top of the visible screen.
Set their alpha to 0.
Create a rule that when self.position.y=height of your scene, change attribute Alpha to 1. (an iPhone screen is 320x480, so depending upon whether you are using landscape or portrait mode, one of those numbers is probably the height of your screen)
If dropping from behind a cloud, simply make the y position the bottom edge of the cloud - might take some messing around here to get the exact right location. However, if you're starting behind the cloud, they may not need to be invisible in the first place - depends upon the opacity of the cloud.
Then - create another rule on the raindrops that says "when self.position.y=0, change attribute self.position.y to 330" (or another value that will place it above the top of the screen, or behind the cloud).
I am assuming you have gravity on the scene; if not, you'll also need a constant downward velocity or acceleration.
I hope that helps!
The actor you want to appear have to have alpha color set to 0 the when you spawn the actor use a boolean attribute to recognize the spawn... then this actor have to get a rule if spawn=true then interpolate self.color.alpha to 1 and that give you the effect... i think
@msones you got it first lol