Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14011

Is there any way to sleep any bodies in space with pymunk?

$
0
0
if event.key == pygame.K_SPACE:            if are_objects_sleeping == False:                for i in objects:                    i.sleep_with_group(i)

As you can see, when the Space bar is pressed, the objects(body in space) go to sleep.uhh...actually it works, but only for 3 seconds. After all of the objects in space being slept, an error is raised

Aborting due to Chipmunk error: Sleeping is not enabled on the space. You cannot sleep a body without setting a sleep time threshold on the space.        Failed condition: cpSpaceGetSleepTimeThreshold(space) < INFINITY        Source:Chipmunk2D\src\cpSpaceComponent.c:321)

Is there any way to make bodies in space go to sleep in no errors?

I want to make bodies in space sleep in no errors when I pressed the space bar.


Viewing all articles
Browse latest Browse all 14011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>