How do I get the mousePressed function to change to different words each time on p5.js?

Hello @sam101

First, a friendly tip: format your code by highlighting it and press the code button (it looks like </> ) in the editor. Easy to read code will most certainly attract more people to help you out. :blush: (There’s more great tips here.)

To answer your original first question (top post has been edited):

This worked at the beginning, but then I added the keyPressed function and somehow the word “Monday” it stoped showing up?

Have you made sure the code is executing alright without throwing errors? You could look for problems using the developer console in your browser.

2 Likes