I am trying to call a method in another object of a class to invoke a gamer restart.
At the moment in the ball class; which will call its own restart class if the ball goes out of bounds
class Ball(Entity):
def restart(self):
self.ball.x = self.ball_starting_spot[0]
self.ball.y = self.ball_starting_spot[1]
# This is where I want to call the player class restart method
The player class has its own restart
method that will have to be called to reset itself. Both classes have the same Entity
base class.
How would I get about this efficiently?