Thats what I am trying to do as well. I only want one image falling from the top at a time and when that image rolls off the screen another falls. But for some reason, when the view loads the images just appear on the screen as if they were placed there from Interface Builder in one solid location. No movement nothing. I have setup the NSTimer as well, so I am not sure what is wrong and why it's not moving.
Quote:
Originally Posted by smasher
Your moveMeteors method needs to loop through all of the meteors in the meteorArray. The post I responded to only wanted one meteor at a time.
Code:
-(void)moveMeteors{
for (UIImageView* myRock in meteorArray ){
//move new center down
CGPoint newCenter = myRock.center;
newCenter.y = newCenter.y +10;
if (newCenter.y > 480){ // if off the bottom
newCenter.y=0; //pop to top
newCenter.x = arc4random()%320; //and pick new x position
}
myRock.center = newCenter;
}
}
|