Example #1
0
 def __init__(self,pos,aim,force):
     pygame.sprite.DirtySprite.__init__(self)
     shoot_vec = gravity.scale(aim,5*force)
     self.layer=2
     self.dirty=1
     self.physics=gravity.small_body(pos,shoot_vec)
     self.image_orig=arrow_png
     self.physics.orient="speed"
     self.image=self.image_orig
     self.rect=self.image.get_rect()
     self.rect.center=pos
     self.name="arrow"
     self.dmg=45
     self.hit=True
Example #2
0
 def __init__(self,pos,aim,force):
     pygame.sprite.DirtySprite.__init__(self)
     shoot_vec = gravity.scale(aim,10*force)
     self.layer=2
     self.dirty=1
     self.physics=gravity.small_body(pos,shoot_vec)
     self.image_orig=rocket_png
     self.physics.orient="speed"
     self.image=self.image_orig
     self.rect=self.image.get_rect()
     self.rect.center=pos
     self.name="rocket"
     self.dmg=50
     self.explode=True
Example #3
0
 def __init__(self,pos,name,img):
     pygame.sprite.DirtySprite.__init__(self)
     self.ammo={"bow":5,"bazooka":-1,"rocket":1,"bat":2}
     self.physics=gravity.small_body(pos,(0,0))
     self.physics.orient="acceleration"
     self.name=name
     self.down=-1
     self.image_orig=img
     self.image=self.image_orig
     self.rect=self.image.get_rect()
     self.rect.center=pos
     self.health=100
     self.invincibletime=0
     self.layer=1
     self.direction=0