Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

This might sound pretty straightforward. I've created a method and I've called it as below in the init method.

[self createNewSpr:ccp(s.width * 0.25,s.height-200)];
[self createNewSpr:ccp(s.width * 0.50,s.height-200)];
[self createNewSpr:ccp(s.width * 0.75,s.height-200)];
[self scheduleUpdate];

I've defined a for loop in my update method that imposes a gravity higher than that of the world on the sprites. Only the last call is affected by the new gravity but the first and second act on the world gravity. I am not sure what is wrong but I suspect it to be the scheduleUpdate. Please Help.

share|improve this question
    
I've added the objective-c tag under the assumption this language is Objective-C. If it isn't, please retag it! –  Jonathan Hobbs May 7 '12 at 9:40
    
Have you tried calling [self scheduleUpdate]; after each create? –  Joshua Drake May 7 '12 at 12:17
    
@JoshuaDrake: calling [self scheduleUpdate]; after each create causes a signal SIGABRT. –  dcone May 7 '12 at 14:26
1  
Perhaps more code would help, specifically, what does the inside of your update method look like? –  dqhendricks Dec 28 '12 at 0:57
    
@JoshuaDrake You shouldn't need to call scheduleUpdate more than once on a specific object unless you have called unscheduleAllSelectors at some point in your code. Once the update is scheduled, the update method will be run once before every frame, and never stop unless you tell it to. –  dqhendricks Dec 28 '12 at 1:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.