Search Results

Search found 159 results on 7 pages for 'srikanth rongali'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Do [sprite stopActionByTag: kTag]; working differently for different CCActions ?

    - by srikanth rongali
    //prog 1 -(void)gameLogic:(ccTime)dt { id actionMove = [CCMoveTo actionWithDuration:1.0 position:ccp(windowSize.width/2-400, actualY)]; [actionMove setTag:6]; [self schedule:@selector(update:)]; [hitBullet runAction:actionMove]; } -(void)update:(ccTime)dt { if ( (CGRectIntersectsRect(hitRect, playerRect)) ) { [[[self getActionByTag:6] retain] autorelease]; [hitBullet stopActionByTag: 6]; } } //prog 2 -(void)gameLogic:(ccTime)dt { id actionMove = [CCMoveTo actionWithDuration:1.0 position:ccp(windowSize.width/2-400, actualY)]; id hitBulletAction = [CCSequence actionWithDuration:(intervalforEnemyshoot)]; id hitBulletSeq = [CCSequence actions: hitBulletAction, actionMove, nil]; [hitBulletSeq setTag:5]; [self schedule:@selector(update:)]; [hitBullet runAction:hitBulletSeq]; } -(void)update:(ccTime)dt { if ( (CGRectIntersectsRect(hitRect, playerRect)) ) { [[[self getActionByTag:5] retain] autorelease]; [hitBullet stopActionByTag: 5]; } } While prog1 is working prog2 is not working ? I think the both are same. But why the two stopActions are working differently in two prog1 and prog2 ? I mean the actions are stopped in prog1 but the actions are not stopping in prog2 ? thank You.

    Read the article

  • How to hide the label (CCLabel) after a certain time in cocos2d ?

    - by srikanth rongali
    I added a label by using CCLabel to my layer. Now I want it do disappear after some time like (2sec). How can I make it to disappear? CCLabel *labelPerfectDraw = [CCLabel labelWithString:@"Perfect Draw" fontName:@"Marker Felt" fontSize:30 ]; labelPerfectDraw.color = ccc3(0x00, 0x00, 0xff); labelPerfectDraw.position = ccp(windowSize.width/2, windowSize.height/2+80); [self addChild:labelPerfectDraw]; I added label in above way. Please give me the idea how can I work on it?

    Read the article

  • how to play video files by using UITableView?

    - by srikanth rongali
    Hi, In my iPhone application I need to show a video image in UITableView. Each tableViewCell have video and some labels. I used the MPMoviePlayerController for showing video in full screen when the cell is selected. But, I am getting error that MPMoviePlayerController class is not there. I tried using UIWebView. But, I could not make it. How can I play a video, when the cell is selected. Some say that videos do not play in simulator. They only play when we test in device. Is it right ? Please help me with the solution. Thank You.

    Read the article

  • How can I write a scrolling text in cocos2d ?

    - by srikanth rongali
    I have a text and it should be abled to scrolled only up and down to see entire text. and my application is a game and written in cocos2d. So, I have layers. There is also an image(CCSprite) adjacent to text. The text should be scrolled and the image have a touchesEnded: property. I used CCLabel for text and CCParallaxNode to add the text. But the text appears like a continues paragraph. But, my text should have different lines. My text is like this. //text starts Hey Player. Do you want to play the game right now then play. Do you want to practice or Play? what want to do? ...text continues //text ends What should I use for this ? Thank you.

    Read the article

  • How to dismiss the MFMailComposeViewController in cocos2d ?

    - by srikanth rongali
    I have changed my code to this way. Now mail controller is opening in landscape mode. But the problem is If I touch on cancel button or send button the mail controller is not dismissing its view. How can I do it ? -(void)goToFirstScreen:(id)sender { NSLog(@"goToFirstScreen: "); CCScene *Scene = [CCScene node]; CCLayer *Layer = [EmailScene node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; [[CCDirector sharedDirector] pushScene: Scene]; } Th EmailScene class is #import "EmailScene.h" #import "testOfEnd.h" @implementation EmailScene - (id) init { self = [super init]; if (self != nil) { [self displayComposerSheet]; } return self; } -(void)displayComposerSheet { [[CCDirector sharedDirector] pause]; picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [[[CCDirector sharedDirector] openGLView] addSubview:picker.view]; [[CCDirector sharedDirector] stopAnimation]; [picker presentModalViewController:picker animated:YES]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [[CCDirector sharedDirector] resume]; //dismiss view after otherwise the code is not executed [picker.view removeFromSuperview]; [[CCDirector sharedDirector] startAnimation]; [picker dismissModalViewControllerAnimated:YES]; //return to previous scene CCScene *Scene = [CCScene node]; CCLayer *Layer = [testOfEnd node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] replaceScene:Scene]; } @end Thank You.

    Read the article

  • How can I play video by touching the button on the video thumnail of the video in tableviewcell ?

    - by srikanth rongali
    I have a table view in which if each cell is touched video plays. Each cell have image of the video cell.imageView.image. And on the image I have a button (UIButton) with play symbol. If I touch the play button the corresponding video should be played same like the when cell is touched. I have a selector for the play button. But I need (NSIndex*)indexPath to get the current row. But I can't access the indexPath in my selector. How can I make this? Thank You.

    Read the article

  • How to reset the value of NSInterval ?

    - by srikanth rongali
    I am writing a small game. After the completion of the game we get the previous screen. So, we can play again. But problem is that the time interval (NSTime Interval)started first time while running game is still continuing. For example the time interval of my touch when I first started game is 3.0 seconds. When again I played (not quitting the application) the time interval is 3.0 seconds + interval till the present touch ? Hoe can I make it work ? Please help me with solution for my problem.

    Read the article

  • How to stop the targets generated by schedule:@selector(target:) interval:timeInterval ?

    - by srikanth rongali
    I am using [self schedule:@selector(target:) interval:timeInterval]; for generating bullets in shooting game in cocos2d. In target: I called method targetGenerate to generate for bullet. The enemy generates these bullets. After the player won or enemy won the game the bullets should stop. But, I could not make them stop. I used flags for this. But they did either work. If I set flag1 = 1; for game won. I am using [self schedule:@selector(update:)]; for updating the bullet position to know it hits the player or not ? And I tried like this -(id)init { if( (self = [super init]) ) { //code for enemy [self schedule:@selector(target:) interval:timeInterval]; [self schedule:@selector(update:)]; }return self; } -(void)target:(ccTime)dt { if(flag != 1) [self targetGenerate]; } -(void)targetGenerate { //code for the bullet to generate; CCSprite *bullet = … } -(void)update:(ccTime)dt { //code for to know intersection of bullet and player } But it was not working. How can I make the bullets to disappear after player won the game or enemy won the game ? Thank you.

    Read the article

  • Should we use NsMutableArray in CGRectIntersect ?

    - by srikanth rongali
    To know whether two sprites cross each other or not, should we use NSMutableArray to store the sprites ? In my game one fixed sprite(player) is there. And the other is a bullet fired and if this sprite intersects player sprite, then enemy won. I have used NSMutable Array to store the bullet sprites. If I do not use NSMutableArray then even though the the bullet intersects player it is not recognizing the intersection ? I am using ( (CGRectIntersectsRect(bulletRect, playerRect)). Thank You.

    Read the article

  • Need some information about using cocos2d in iPad.

    - by srikanth rongali
    Hi, I need some information about using cocos2d in iPad. Can we use 2048x2048 sprite sheets ? I read in this form that we can use but with limitation not more than 3 or 4 sprite sheets. But, I have 10 animations in my game. maximum of 4 animations run at a time. Can we use the CCDirectors in AppDelegate in the same way as we use in iPhone ? if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] ) [CCDirector setDirectorType:CCDirectorTypeDefault]; [[CCDirector sharedDirector] setPixelFormat:kPixelFormatRGBA8888]; [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888]; What can be the maximum size of the image that we can use? Any limitations regarding the cocos2d and iPad please post them. Thank you.

    Read the article

  • How to recognize the touch of a non regular sprite image ?

    - by srikanth rongali
    I have a sprite and if it is touched the touch should be recognized. I used the coordinates to do so. I took the coordinates (min x, min y, max x , max y)of the sprite image. But The sprite image is not a rectangular shape. So, even if I touch the coordinates outside the sprite and inside the rectangular bounds the sprite is recognized. But for my application I need only the sprite to be recognized. So, I have to take only the coordinates of the sprite, but it is not regular shape. I am using CCSprite in my program. So, what can I do to for only the sprite to be selected ? Which classes should use for this? Thank You.

    Read the article

  • How can I add sprite image from a set of sprites which have different properties for each sprite?

    - by srikanth rongali
    In my application one player and 10 targets are there. Each target appears one after the other (from target1 to target10). It's a shooting game. If we hit the first target then second target will come. The targets have properties like name, speedOfGunDraw, probability to hit the player, speedOfFire. What should I do to make them appear one after the other with these properties. I am using CCMenuItem for the target. I am using a sprite for the player. Please give me idea to do this. Thank You.

    Read the article

  • pushScene and popScene or replaceScene . which should we use and when ?

    - by srikanth rongali
    I am using push scene to get the next scene. But, I read that for each PushScene the scene is stored in stack. The memory usage is more. So, I am using the replaceScene in place of pushScene. But, with replace scene I am getting the memory-bad-access message in debugger. So, I want to popScene after using it, so that the retain count is zero. But, I am confused in using popScene. If I have a Scene1 and Scene2. I used the following to go in to Scene2. Now I need to remove Scene1 from stack. [[CCDirector sharedDirector] pushScene:Scene2]; Where should I write the popScene to popScene1. How to get the previous scene in current running scene ? Thank you/

    Read the article

  • Application crashing in the iPad but working fine in iPad simulator.

    - by srikanth rongali
    Hi, I am writing a game in cocos2d. In the iPad Simulator the application is running good. While I am running the application in the iPad. But it was crashing by giving the following message in terminal. I am using 2048x2048 CCSpriteSheets in my code. I used instruments tool there is sudden increase in memory to 32MB before crashing. It is crashing at CCSpriteFrameCache . Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-6258-64 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none continue The program is not being run. The program is not being run. Thank you.

    Read the article

  • How can I a sprite image from a set of sprites which have different properties for each sprite?

    - by srikanth rongali
    In my application one player and 10 targets are there. Each target appears one after the other (from target1 to target10). It's a shooting game. If we hit the first target then second target will come. The targets have properties like name, speedOfGunDraw, probability to hit the player, speedOfFire. What should I do to make them appear one after the other with these properties. I am using CCMenuItem for the target. I am using a sprite for the player. Please give me idea to do this. Thank You.

    Read the article

  • How to reset all the values after completion of the game, before starting it again ?

    - by srikanth rongali
    I have writing a small shooting game in cocos2d. Winning the game is to eliminate all the 10 enemies. After that end screen comes showing 'You Won' and 'Play Again'. If I go for 'Play Again' option the game is starting from where I need. But, the problem is that the game is continuing from previously ended state. I mean it is not starting from enemy 1 again instead it is just showing the end of 10 enemy. I think I have to reset all the values before pushing the scene. But should I reset all the values I have used or there is any other way ? Thank You.

    Read the article

  • how can we count the time interval of the animation in cocos2d ?

    - by srikanth rongali
    Hi, I am doing my program in cocos2d. I am using NSDate to get the current time of the start of animation. And I know my animation takes 3 seconds. So I can get the time at completion of animation by using NSInterval and using the previous time and animation time. But, if If the animation time interval is not fixed how can I calculate the time interval of the animation and time at the completion of the animation ? I am animating a sprite. Please help how can I make it. Thank You.

    Read the article

  • how to change the game developed in iphone to ipad ?

    - by srikanth rongali
    I have developed a game for iPhone using coco2d 0.99.3. I want it to work on iPad. I have the new images which are bigger in size and resolution than iPhone images. I replaced the images and checked, but the image is appearing only in iPhone simulator which is inside the iPad simulator. What changes shall I make ? Thank You.

    Read the article

  • How to solve the delay problem in animation of sprites ?

    - by srikanth rongali
    My problem is, I did coding for a sprite. It should change it should change it's image from( 1, 2, 3). It should look like count down time to start a game. 1, 2, 3 are 3 png images. But the images are not displayed in equal intervals of time. I mean time between (1 - 2), (2 - 3) is not same. It is random. Please help me with my problem. Help me if there is better solution than what I am doing.(My animation should be like, before any game starts we see count down 1 then 2 then 3 then GO). -(id)init { if((self = [super init])) { [[CCDirector sharedDirector] setAnimationInterval:60.0/60]; [[CCDirector sharedDirector] setDisplayFPS:NO]; CCAnimation* numberAnimation = [CCAnimation animationWithName:@"countDown" delay: 60.0/60]; for( int i=1;i<4;i++) [numberAnimation addFrameWithFilename: [NSString stringWithFormat:@"number_%02d.png", i]]; id numberAction = [CCAnimate actionWithAnimation: numberAnimation restoreOriginalFrame:NO]; id action2 = [CCFadeOut actionWithDuration:0.5f]; CCSprite *number; number = [CCSprite spriteWithFile:@"number.png"]; .... } }

    Read the article

  • Why multitasking is not supported in iPhone ?

    - by srikanth rongali
    Many are saying that Apple has restricted it for better performance. It should increase the size of RAM to support multitasking. So, they Apple is not allowing it. But some say that Cocoa Touch applications can't be multitasking as iPhone has only one window and views on it. But I could not understand what is the correct reason for this ? Please clarify me.

    Read the article

  • How to stop the horizontal scrolling programmatically ?

    - by srikanth rongali
    I have a UITextView *textView in cocos2d's CCLayer. The text is scrolling in both the horizontal and vertical directions. But, I need it to scroll and bounce only in vertically. How to stop the horizontal scrolling programmatically ? UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(100,200, windowSize.height/2,windowSize.width/2)]; textView.backgroundColor = [UIColor clearColor]; textView.text = @"I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy I am First enemy"; [textView setEditable:NO]; textView.font = [UIFont fontWithName:@"Helvetica" size:24.0f]; CGPoint location = CGPointMake(200, 160); textView.showsHorizontalScrollIndicator = NO; //textView.bounces = NO; //textView.alwaysBounceVertical = YES; textView.center = location; textView.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS( 90.0f )); What should I do stop scrolling horizontally ? Thank You.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >