I am a beginner at python processing 3. I am currently making a Pacman game and I am having trouble making the menu.
I would like to have the menu so that when the player clicks on the controls button, it will bring them to the controls page.
However, the code that I have made allows me to click wherever and will bring me to the controls page.
Also, the controls page will only last for around one-eighth of a second.
Here is my code so far:
def setup(): global menu, controls, whatever size (750, 750) menu = loadImage ( "startmainmenu.jpg" ) controls = loadImage ( "keycontrols.jpg" ) whatever = loadImage ( "gameover.jpg" ) def draw(): global menu global startbutton, controlbutton image(menu, 0, 0, 750, 750) startbutton = rect (136, 263, 477, 159) controlbutton = rect (136, 484, 477, 159) noFill() noStroke() def mousePressed(controlbutton): if mousePressed == True: image(controls, 0, 0, 750, 750)