Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Random Rocks
View Single Post
Old 01-06-2010, 03:31 PM   #23 (permalink)
kdp8791
Registered Member
 
Join Date: Sep 2009
Posts: 57
kdp8791 is on a distinguished road
Default

Sweet! It's working! Thank you SO MUCH. If I setup a new NSTimer is it possible to use it to delay image's from falling rather than it just fall immediately after the other disappears.

Quote:
Originally Posted by smasher View Post
If you only want one meteor, you should not create the array of meteors; you should just create one meteor "myRock". I also changed it to "y = 0" - if you're only making one rock it makes sense to put it at the top of the screen, not far off the top like the other code.

Code:
-(void)createMeteors{
	
	UIImage *meteorImage = [UIImage imageNamed:@"flake.png"];
	
	myRock= [[UIImageView alloc] initWithImage: meteorImage];
	
	//pick a position *above* the top of the screen
	int x = arc4random()%320; 
	int y = 0; // place at top of the screen
	myRock.center = CGPointMake (x,y);
	
	[self.view addSubview: myRock]; //adds meteors as subviews
	[myRockrelease];	
}
__________________
kdp8791 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,427
Threads: 94,023
Posts: 402,573
Top Poster: BrianSlick (7,978)
Welcome to our newest member, shakiraeb60
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:47 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.