views:

164

answers:

2

Hi everyone.

I have some trouble with my game (using Cocos2D). I have an introduction, then it will go to the game afterward. The thing here is, on the simulator, it always appears at real-time when it switches scene Intro to GamePlay. But in the actual phone, I know it would be slower and take more time to switch. But before the player can see the GamePlay scene, the timer for the game starts to count,( the player has 30 seconds to play the game), and then music also starts already before the screen appears. Then when it goes to the GamePlay screen, the timer will still be 30 seconds, but it actually passes few seconds. So that is why when the player sees the timer show 4 seconds ( or sometimes 3 or 6) it already display that he loses. He would not know the timer actually started before he saw the screen.

I don't know how people solve this problem. Could anyone help me out. Thank you so much.

PS: I think what about I put a loading page while it loads like other games, But bad thing is I don't know how to do so. I just have an idea.

This is my timer code, these are in init

[self schedule:@selector(endGame:) interval:1.0f]; [self schedule: @selector(timeCounter:) interval:1.0f];

-(void) timeCounter:(int) dt
{

    timer -=1;
    LabelAtlas *label2 = (LabelAtlas*) [self getChildByTag:kTagSprite2];
    [label2 setString: [NSString stringWithFormat:@"%d", timer]];
}

//This determines when the game ends

-(void) endGame:(ccTime)dt
{
    milliSeconds++;
    int i = 30;
    if (milliSeconds == i)
    {
        [currentSound stop];
        LostScene *loser = [LostScene node];
        [[Director sharedDirector] replaceScene:[FadeTransition transitionWithDuration:0.1 scene:loser]];
    }

}
A: 

You could add some sort of 'tap the screen to begin playing' layer, which in turn would schedule the timers and make the layer disappear.

arul
could you elaborate more please? This is my first game so I am not quite sure. Thank you if you help me more
Rocker
oh yea. I understand what you suggest now. Actually, the player needs to tap to go to the gameplay. There are texts, the player has to preview all text before he can go to game play. So to review the text, he needs to tap on the screen. After seeing the last text, he taps the last time. It will let him go to the play game.
Rocker
A: 

hey if have found the ans plz paste code..

kartik donda