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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-04-2010, 12:49 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 240
seenu87 is on a distinguished road
Question emitter

am adding emitter(child) in my update method.(after collision detection) after removing the emitter when touches moved method.

its working fine.
my problem is after removing the child (when touches moved) then added because of in the update method for adding child(emitter)

code:-
Code:
- (void)update:(ccTime)dt {
emitter1.position = ccp(v1,v);
[self addChild:emitter1];
}
Code:
- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {   
[self removeChild:emitter1 cleanup:YES];
}
how to rectify this.

Last edited by seenu87; 12-04-2010 at 01:35 PM.
seenu87 is offline   Reply With Quote
Old 12-04-2010, 02:38 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 240
seenu87 is on a distinguished road
Question

Quote:
Originally Posted by seenu87 View Post
am adding emitter(child) in my update method.(after collision detection) after removing the emitter when touches moved method.

its working fine.
my problem is after removing the child (when touches moved) then added because of in the update method for adding child(emitter)

code:-
Code:
- (void)update:(ccTime)dt {
emitter1.position = ccp(v1,v);
[self addChild:emitter1];
}
Code:
- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {   
[self removeChild:emitter1 cleanup:YES];
}
how to rectify this.


how to rectify the above problem.

any help....................
seenu87 is offline   Reply With Quote
Old 12-04-2010, 05:08 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by seenu87 View Post
am adding emitter(child) in my update method.(after collision detection) after removing the emitter when touches moved method.

its working fine.
my problem is after removing the child (when touches moved) then added because of in the update method for adding child(emitter)

code:-
Code:
- (void)update:(ccTime)dt {
emitter1.position = ccp(v1,v);
[self addChild:emitter1];
}
Code:
- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {   
[self removeChild:emitter1 cleanup:YES];
}
how to rectify this.
You need to give more context.

I guess, from the fact that I've seen "ccTouchesMoved" methods in other posts on Cocos2d that this is cocos2D code? If so, please mention that in the header. I've never used Cocos2D, and have no idea how to help. People who know about it would see the subject and offer their help.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 12-05-2010, 04:38 AM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 240
seenu87 is on a distinguished road
Default

how to rectify the above problem.

any help....................
seenu87 is offline   Reply With Quote
Old 12-05-2010, 01:33 PM   #5 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 342
flamingliquid is on a distinguished road
Default

I'm not sure I understand what you are asking, are you wondering how to stop the scheduler from running after you remove the emitter?

If so, use this:
Code:
// If you want to stop all of the scheduled selectors
[self unscheduleAllSelectors];

// If you just want to stop the update: selector
[self unschedule:@selector(update:)];
Hope that helps
__________________
17 year old nerd.
Send me a PM. Maybe I can help.
flamingliquid is offline   Reply With Quote
Old 12-05-2010, 11:20 PM   #6 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 240
seenu87 is on a distinguished road
Question

Quote:
Originally Posted by flamingliquid View Post
I'm not sure I understand what you are asking, are you wondering how to stop the scheduler from running after you remove the emitter?

If so, use this:
Code:
// If you want to stop all of the scheduled selectors
[self unscheduleAllSelectors];

// If you just want to stop the update: selector
[self unschedule:@selector(update:)];
Hope that helps
Thanks for u r reply. i stopped the timer means its working. but am writen the code for collision detection in update method. once i unschedule this means collision detection is not working.

so, any other solution for stop this emitter effects.
seenu87 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 370
6 members and 364 guests
chemistry, daudrizek, HemiMG, Kirkout, MarkC
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,665
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daudrizek
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:51 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0