lag

My collision detection isn't working and way to laggy

My collision detection isn't working and way to laggy Question: So here’s just the base function: def xCollision(self): for tile in tiles: if tile.colliderect(self.rect): if self.x_vel >= 1: self.rect.right = tile.left elif self.x_vel <= -1: self.rect.left = tile.right def yCollision(self): for tile in tiles: if tile.colliderect(self.rect): if self.y_vel >= 1: self.rect.bottom = tile.top elif self.y_vel …

Total answers: 1