'Removes from sprite group if off screen'

def check_if_off_screen(self, viewport):

    if ((self.rect.x > viewport.right) or (self.rect.y > viewport.bottom) or (self.rect.right < viewport.x)):
        self.kill()
