Move triangle up and down using 'w' and 's' keys

Hey I need help with moving my triangle up and down using the ‘w’ and ‘s’ keys. I’ve tried many different types of codes such as using keyPressed, etc but it hasn’t worked out for me. This is what I have at the moment

size(500,500); {

}

triangle(20,10,80,30,20,50);{

}

Hello,

Explore the resources available here:

To interact with the triangle you will need at least:

  • setup()
  • draw()
  • keyboard control

:)