Bullet physics in python and pygame

Posted by Pomg on Game Development See other posts from Game Development or by Pomg
Published on 2012-03-30T15:28:41Z Indexed on 2012/03/30 17:44 UTC
Read the original article Hit count: 509

Filed under:
|
|

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.rect.top += self.yv

© Game Development or respective owner

Related posts about python

Related posts about pygame