Tag Info

New answers tagged

0

Here is a suggestion: def compute_final_damage(self, raw_damage): """Apply armor to the damage""" return raw_damage * (self.armor / (100 + self.armor)) def take_damage(self, damage, attacker=None): """Takes damage from a source.""" final_damage = self.compute_final_damage(damage) self.base_health -= final_damage ...


0

If you read the pygame.time.Clock.tick() and pygame.time.Clock.get_fps() documents, you'll find that: tick() works with milliseconds - it returns the number of milliseconds since the last call get_fps() returns an average of the last 10 calls to tick(). If you do the math, that's pretty damn good that you're getting 59.8 most of the time, since with 60 FPS ...


0

You've made an infinite loop: def nextStageCollision(self): for tile in self.nextStageCollision(): You probably meant something like: def nextStageCollision(self): for tile in self.tileList: Note what you are iterating over. You are calling the nextStageCollision to find what to iterate over, which calls nextStageCollision to find what to ...



Top 50 recent answers are included