The folder shows some basic processing skeleton codes for you to understand the language and some basic techniques.
Different methods to draw eyes that track mouse location. The trigonometry approach is the most preferred one, but you can definitely go ahead and use map(). If you use map(), it is important to adjust the parameters to suit your design.
The least wanted approach is constrain(). You can't simply constrain mouseX and mouseY, that will give you weird movement of the pupils. However, there is a way to use constrain() to complete the task. I have not tried to do this, but you can get some idea from the code I find on the processing forum.
A practice code to show basic usage of class, array and mousePressed().
A demo that uses object to generate arrays of randomly generated stars.