Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6596513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:05:10+00:00 2026-05-25T18:05:10+00:00

all I am facing one problem the problem is that I want to hit

  • 0

all

I am facing one problem the problem is that I want to hit an object infinite time and it show me the animation only once.. how can I do it.. plz give me an idea of this

code

ccTouches Function

if(firstValue >= 125 && sencndvalu <=138)
        {
            if(multipleTouch == 0)
            {   
                [self FaceAni:@"chammat.plist"];
            }
            multipleTouch ++;

            if(multipleTouch > 2)
                [self fallingAnimation:@"fallingNew.plist"]; 
        }

}

-(void)FaceAni:(NSString *)plistFile
{

multipleTouch = 0;

animationIsOn = 1;

[self removebackgroundTexture];

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:plistFile];        

NSString *changeFileName = [NSString stringWithFormat:@"%@", plistFile];

changeFileName = [changeFileName stringByReplacingOccurrencesOfString:@".plist" withString:@".png"];

spriteSheet = [CCSpriteBatchNode batchNodeWithFile:changeFileName];

[self addChild:spriteSheet];

// Load up the frames of our animation
walkAnimFrames = [NSMutableArray array];
for(int i = 1; i <= 20; ++i) 
{ 
    if(i <= 9)
    {
        [walkAnimFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"Chmaat_0000%d.png", i]]];
    }
    else
    {
        [walkAnimFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"Chmaat_000%d.png", i]]];
    }
}
CCAnimation *walkAnim = [CCAnimation animationWithFrames:walkAnimFrames delay:0.10f];

// Create a sprite for our bear
CGSize winSize = [CCDirector sharedDirector].winSize;
self.bear = [CCSprite spriteWithSpriteFrameName:@"Chmaat_00000.png"];      

_bear.position = ccp(winSize.width/2, 230);

self.walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkAnim restoreOriginalFrame:NO]];
//[_bear runAction:_walkAction];
[spriteSheet addChild:_bear];
[_bear runAction:_walkAction];

// [[SimpleAudioEngine sharedEngine]playEffect:@”slap3.wav”];

timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(removeFrame) userInfo:nil repeats:NO];

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:05:11+00:00Added an answer on May 25, 2026 at 6:05 pm

    You could:

    • set a Boolean flag that is initiated with a value of YES
    • in your method that runs the animation, check the status of that Boolean flag. If YES, run your animation
    • then have that method set the flag to NO.

    The first time the animation is shown the flag will be set to NO and the animation won’t run again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing one problem ,that when the google map is loading then there
I am facing a problem that I can not understand . During a plugin
I have three pages that has forms on them. They all lead to one
I am building a middle size system and I am facing a problem that
In short: I want to show a view or action sheet and only continue
I've worked on projects that have very complex XML configuration, and one problem that's
I'm facing a problem with the nested set model, with MySQL. I can insert,
I am facing one problem. I have a directory named as Album under my
I have a big ol' .po file containing all the user-facing strings I need
I'm facing to do the unit test on the data access layer, all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.