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

  • SEARCH
  • Home
  • 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 6007707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:43:10+00:00 2026-05-23T01:43:10+00:00

In chipmunk/cocos2d, I have the classic bouncing ball demo happily running with an arbitrary

  • 0

In chipmunk/cocos2d, I have the classic bouncing ball demo happily running with an arbitrary number of balls.
How can I tell when a sprite has stopped moving (i.e. the ball has settled to the bottom and is “done”)?

I tried declaring float prevX, prevY in the Layer class, so I could compare current x,y to previous x,y in updateShape, but I can’t access the sprite’s parent.

         ((CustomLayer *)(sprite->parent))->preX = body->p.x;

The compiler informs me that the sprite’s parent is protected.

Thanks.

  • 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-23T01:43:11+00:00Added an answer on May 23, 2026 at 1:43 am

    If you have Chipmunk’s sleeping algorithm enabled, you can just call cpBodyIsSleeping().

    Chipmunk figures out when things are idle by checking that their kinetic energy is lower than a certain threshold and incrementing a timer. If the timer reaches a certain amount, then it considers the body to be idle.

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

Sidebar

Related Questions

Here is my problem. I have a chipmunk's rigid body (a soda can standing
If I have two objects in chipmunk (I'm using cocos2d-iphone), once I've detected that
I'm trying to create a squishy ball with Cocos2d and Chipmunk (via SpaceManager) using
I have a simple animation in Cocos2d Chipmunk with the tasks: One round shaped
I'm using Chipmunk 5 for iPhone, with Cocos2D. Upon collision between two specific objects
I am doing a game with cocos2d and using chipmunk to manage the physics.
I am completely new to chipmunk and I have just been using it for
I can't seem to find any tutorials on how to use Chipmunk from Ruby,
I have a cocos2d game with a CCLayer called GameplayLayer placed inside a scene.
I'm using Chipmunk cocos2d for what will ultimately be a sound-generation game where colliding

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.