Closed cyanidecupcake closed 7 years ago
I am still encountering this issue when I try to play your game. Are you sure you fixed it?
Few things to help with this, @TruKave
Instead of contains
, use colliderect
. It's more sensitive to collisions.
if self.damage == 0:
for enemy in enemy_hit_list:
- if not self.rect.contains(enemy):
+ if self.rect.colliderect(enemy):
self.damage = self.rect.colliderect(enemy)
print(self.deaths)
Also, get rid of your noclip
variable check in the collision. if
statements are tricky enough without making them inclusive of a negative.
- if self.damage == 1 and noclip == False:
+ if self.damage == 1:
That should fix the issue.
@notklaatu Removing noclip == False
didn't make a difference, and I'm not sure if the colliderect one did. The colliderect one feels better, but I don't think it is.
When Player is moving at full speed it can walk through enemies. When stopped or moving slowly, it returns to start and the score changes.
This is due to an indentation error. I recommend you look inside the Player update function. Make sure you don't have enemy code inside of code for something else, probably code that deals with movement.