So, I've been working on a project in PyGame. To test the currency system out, I've decided to increment the money you have when a key is pressed. I've tried moving the if statement out of the game loop. Here's my code:
gameRun = True
while gameRun:
for event in pygame.event.get():
if event.key == pygame.K_p:
print("This Should Work")
currency.balance.amount += 1
pygame.display.update()
I have other several other lines of code but I believe that there is something wrong about these lines. Thank you so much!