Tag Info

New answers tagged

0

ios objective-c version: CGSize winSize = [CCDirector sharedDirector].winSize; CCSprite *player = [CCSprite spriteWithFile:@"Games1.png"]; player.position = ccp(player.contentSize.width/2, winSize.height/2); CCActionInterval *a = [CCOrbitCamera actionWithDuration:2 radius:1 deltaRadius:0 angleZ:0 deltaAngleZ:360 angleX:0 deltaAngleX:0]; [self ...


0

I would say, that you could use a single timer for all of these. If I don't recall wrong, Minecraft uses a system very similiar to this. Everything that needs a cooldown(Like redstone), uses "ticks". Every second is composed of 20 ticks. The game checks for the number of ticks to calculate timing. Applied to your situation would be like this: You could have ...


0

It seems you're spending too much of your mental and motivational resources attempting to circumvent a problem that will likely never realize. Are you planning on having 10's or 100's of thousands of timers simultaneously? Or will it be a handful of timers for a handful of entities? If the latter, which would be nearly certainly the case for the vast ...


1

Many individual timers can cause race conditions. Set one timer to 50 ms, 10 ms later set another timer to 40 ms. Which one will fire first? Often there is no way of knowing, and the result may be different from one run to another due to minor performance variations. Often it is not an issue, but bugs caused by race conditions can be really hard to track. ...


4

Given the options in your question, separate timers would be the best approach. I'm not sure what your implementation of the "timers" is but you can get a major performance increase and simplify things by using a different approach. Rather than using timers (as in stop-watch type timing) you could use time stamps that represent the expiration of a cooldown ...


1

The problem is that you are moving the label to the right (420+10 points). I don't know what do you want to achieve with this action but basically you are continuously moving the label to the right. If you don't understand, change the duration of the animation to something like 2 and you will see the problem.


0

I have figured it out, I just added another animation which consists of 1 frame, then when i need it, i play the animation: [mySprite stopAnimation]; //Stops CurrentAnimation [mySprite prepareAnimationNamed:@"jumpAnimation" fromSHScene:@"Jungle"]; [mySprite playAnimation];


0

This is super general advice, and I'm no Obj-C expert, so take it with a grain of salt. Having said that, I'd recommend that you think very carefully about what each variable is for and give them more appropriate names. Write lots of comments. Click on the line numbers to create a breakpoint, and run your app in the simulator. It will pause at the ...



Top 50 recent answers are included