Mercurial > nagslang
diff nagslang/protagonist.py @ 356:582a96e5fdac
Tweaks to the claw attack.
author | David Sharpe |
---|---|
date | Fri, 06 Sep 2013 18:41:29 +0200 |
parents | 63d0c70a4e15 |
children | d2c7e17299a7 |
line wrap: on
line diff
--- a/nagslang/protagonist.py Fri Sep 06 17:32:25 2013 +0200 +++ b/nagslang/protagonist.py Fri Sep 06 18:41:29 2013 +0200 @@ -1,3 +1,5 @@ +import math + import pymunk import pymunk.pygame_util @@ -297,7 +299,10 @@ self.physicser.position, vec, BULLET_DAMAGE, COLLISION_TYPE_PLAYER) def claw(self): - vec = vec_from_angle(self.angle, 300) + claw_range = (math.sqrt(math.pow(self.physicser.get_velocity()[0], 2) + + math.pow(self.physicser.get_velocity()[1], 2)) + / 20) + 30 + vec = vec_from_angle(self.angle, claw_range) ClawEvent.post(self.physicser.position, vec, CLAW_DAMAGE) def in_wolf_form(self):