We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Is it possible to add movement to a sketch without using the draw function?
I am currently using the display: function(){ because I have multiple things to show when the mouse is clicked. In this display: function(){ is it possible to have movement in the sketch? or is movement only possible in the draw function?
Thank you
Answers
You can split the tasks to do in separate functions.
Then invoke them from draw() or some other triggered callback.
Encapsulating behavior in classes is another excellent way to modularize code:
https://developer.Mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes