0

Why can my button on my previous screen in my python game can be pressed when I'm on another screen?

First of all the line: if event.type == pygame.MOUSEBUTTONDOWN, does not work for my main menu buttons so when I hover over the buttons the screen changes correctly but I want to code it so when I press the buttons, that is when the screen should change. However, the code works for the other screen so when I hover over the buttons there is no change but when I press the buttons the screen changes to where I coded it to change. Now to the main issue I have stated, when I press the middle button on the screen , e.g. the medium difficulty mode on the page where I select the difficulty mode for the game, the buttons on the previous screen can still be pressed on certain areas of the button. For example, if I pressed in the middle of the button I would go to the settings page instead of the game loading screen. If you are able to help me with this problem I will greatly appreciate it. Thank you in advance :)

27th Nov 2024, 12:58 PM
Natasha
1 Odpowiedź
0
Sorry... But I don't know anything about python
8th Dec 2024, 3:24 PM
Harsh king
Harsh king - avatar