I have class shop. When making the __init__ I need to give it a function within one of the parameter player. If I give it the function though, the function executes from within the parameter of the class shop, rather than executing when the shop class executes it
def openCabin(p): gD.fill(black) health = getattr(p, 'damageTaken') healthSub = health - (health * 2) p.damageTake(healthSub) pygame.display.update() time.sleep(5) Cabin = Building(260, 30, 200, 200, Buildings[1], openCabin(p))The function executes one line 9 where it says "openCabin"