Question: I’m trying to make my program paint when the p key is pressed. It is not working
Repl link: https://replit.com/@Andrewdagod/p5-Project4334
function draw() {
background(200)
stroke(50)
if(keyCode === 80) {
ellipse(x, y, 100, 100)
fill(rgb(255, 0, 0))
}else {
ellipse(x, y, 100, 100)
fill(200);
}
ellipse(x, y, 100, 100)
keyPressed()
}
code snippet