Reputation: 253
is it possible to have particles without using cocos 2D. I know particle designer but we have to use it with cocos 2D. How can I make particles without cocos 2D ??
Upvotes: 2
Views: 1601
Reputation: 6893
You want to go right to 71Squared. He provides videos of creating a very cool particle engine without Cocos2d. Then, once you have your particle emitter workin, you can go ahead and create a simple class to store the particle sets if you want - I did this for my app.
Upvotes: 0
Reputation: 1401
You can do it by spawning an image and adding it to an array, which makes it extremly easy to animate the image or do whatever with it.
- (void)createImage {
UIImageView *Image = [[UIImageView alloc] initWithFrame:CGRectMake(arc4random() % 320, 480, 40, 40)];
[Image setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:Image];
[myArray addObject:Image];
}
That creates a black image wherever and adds it to an array.
Then, you can make a timer and spawn the image every second!
spawn = [NSTimer scheduledTimerWithTimeInterval:1.0/3 target:self selector:@selector(Spawn) userInfo:nil repeats:YES];
- (void)Spawn {
[self createImage];
}
Upvotes: 1