game-physics

Why does the moon spiral towards Earth in simulation?

Why does the moon spiral towards Earth in simulation? Question: I am trying to simulate a somewhat realistic program where Earth and the moon can interact gravitationally with each other. Now the problem is that the moon keeps on spiraling towards Earth and I don’t understand why. This is my code: from math import sin,cos,sqrt,atan2,pi …

Total answers: 1

How do I "Push" an object (crate) with another object (player) in Pygame?

How do I "Push" an object (crate) with another object (player) in Pygame? Question: I’m trying to make a pushable crate using Pygame. I’m able to push the crate in all directions (up, down, left and right) which works fine. I can also push the crate up or down and move left and right at …

Total answers: 1

tracing image in pygame

tracing image in pygame Question: lately I’ve been trying to create a ping pong game with Pygame but I can’t seem to figure out why? or how the ball started tracing when I made it a moving object in the game. how can I go about fixing this problem? import pygame, sys def ball_ani(): global …

Total answers: 1