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 6863233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:45:27+00:00 2026-05-27T02:45:27+00:00

I was trying to animate a sprite only once but it is animated twice

  • 0

I was trying to animate a sprite only once but it is animated twice can any one help me with this?? Here is the code

    CuttingLineEffect(float x, float y, TiledTextureRegion line_region)
{
    super(x, y, line_region);
    this.animate(60, 1);
    this.mPhysicsHandler = new PhysicsHandler(this); 
    this.registerUpdateHandler(this.mPhysicsHandler);
    this.setPosition(x-this.getWidth()/2-50+this.getWidth()/2,y+50);
}

@Override
protected void onManagedUpdate(float pSecondsElapsed) {

    if(!set)
    {
        MainMenu.LineList.add(this);
        set = true;
    }
    if(!this.isAnimationRunning() && !time_to_unload)
    {
        time_to_unload = true;

    }


    super.onManagedUpdate(pSecondsElapsed);
};
  • 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-27T02:45:28+00:00Added an answer on May 27, 2026 at 2:45 am

    The Animate() second parameter is how many times you want to loop that animation. because you only want to animate it once you might aswell use.

    this.animate(60,0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to animate only the y position of a background image. Code works
Trying to animate background color on page load but it only works when I
I am trying to transform a moving animated sprite to be a reverse of
I am trying to animate the transform property of a view. Here is my
I'm trying to animate a logo. The markup looks like this: <div id=logo> <h1>
I am trying to animate sliding out one view from a window and simultaneous
I am trying to animate a div moving 200px horizontally in JavaScript. The code
I am trying to make a sprite animate in cocos2D . I believe I
Question How can I animate and form rows together? Explanation One 'for loop' is
I'm trying to animate a view sliding into view and bouncing once it hits

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.