Your problem is that neither the spaceship classes nor asteroids revise their own rect (their hitboxes) to update , and their x and y attributes have no direct or automatic connection to the location of this rectangle. If you add something like self.rect.topleft = self.x, self.y to the end of your update function for both classes, then their respective rectangles - that is, your hitboxes - will move to where they should be, instead of to stay in their initialized places, which in this case is equal to (300 550) for player and ... some semi-random bias for each asteroid (I'm not sure where exactly: all I did was to play your code carelessly, and then check the bunch, I apologize for not finding the exact origin of the problem ...)
In any case, the short answer is that although you have a current check for the x and y locations for each sprite, you did not tell pygame to actually apply that location to the hitbox, and sprite.spritecollideany always Falsey, because that the blows themselves were not directly related.
Entering self.rect.topleft = self.x, self.y at the end of each of your sprite classes update will fix it. (Make sure this line is at the end of the function and at the lowest indent level in def update(self) !)
EDIT
Alternatively, instead of adding the above code to update you can replace player.x = x_ship and player.y = y_ship in your main loop with something like:
while keepGoing: ... player.rect.move_ip(x_ship, y_ship)
I would use the update -altering solution, as there is a really good chance that this solution will cause you grief when a player approaches the edges of the playing field. However, another opportunity for you to consider.
As a suggestion, you can redefine <Sprite>.x and <Sprite>.y as property , which return self.rect.left and return self.rect.top respectively, so the x and y values ββare bound to the top of your hitbox. The retina is also even.
I'm not sure how you can use these options in the future; you may be able to completely destroy them if you want, and use rect s locators instead. Food for thought!
Note:
I also assume that all sprite x and y attributes refer to the upper left of its rect . If this point should be somewhere else (for example, in the center), you may need to make adjustments to this code if you decide to use it.