Mo-Official / DHBW_python

Repo für die Python Vorlesung des 4. Semester
0 stars 0 forks source link

BUG: player left movement flag not being set correctly #13

Open Mo-Official opened 3 years ago

Mo-Official commented 3 years ago

The bug is in sprites.py in the Player.update_movement_flags() and Player.movex()

        elif self.vel.x//1 < 0:
             # BUG: movement_flag is being set to true falsely.
             # See issue here for more information. 
            self.movement_flags["left"] = True

The problem is that self.vel.x becomes so small that when rounding up using self.vel.x//1 it is rounded to zero, thus losing the negative sign.

Possible solutions: