Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am programming a 2D sidescroller in python and pygame and am having trouble making a bullet go farther than just farther than the player. The bullet travels straight to the ground after i fire it. How, in python code using pygame do I make the bullet go farther. If you need code, here is the method that handles the bullet firing:

    self.xv += math.sin(math.radians(self.angle)) * self.attrs['speed']
    self.yv += math.cos(math.radians(self.angle)) * self.attrs['speed']
    self.rect.left += self.xv += self.yv
share|improve this question
This is way too vague, you should post some snippets of code (not the whole program). – o0'. Mar 30 '12 at 15:56

It's unclear what happens to the bullet.

Does it have the same speed as the player? In that case, obviously the bullet should have a greater speed.

Does it disappears just after it appeared? Maybe you misplaced it and collided with the player.

share|improve this answer

There is a 2D physics engine that integrates nicely with PyGame. It is called PyMunk and uses the Chipmunk 2D physics engine. You might want to use it if you do something more with physics in your games.

share|improve this answer
This does not appear to really address the asker's issue. – Josh Petrie Jan 9 '14 at 4:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.