Monday 5 September 2011

mousePressed() and Double Clicking

Experiments

This first experiment is an attempt to take mousePressed() and take it to its next logical conclusion.

Double Clicking!

This experiment was to show how double clicking might work. I used the frameCount variable as a type of clock. If the user clicks twice within three frames of draw() the circle changes colour, but a single click will only produce a 'selection' like effect.

And it works. I wanted it to simulate the feel of clicking or double clicking a file on a computer. However, it does seems to have some issues. For one the double click should never appear without the selection effect, and it does. Secondly, when this does occur, the colour change can only be removed by clicking on the circle again. When things don't perform as expected, this can be a problem for the user experience.

If I get a chance I'd like to rewrite the code of this example in a later blog post. Spending a long time overcoming issues  really made me appreciate the importance of using comments and naming variables.

Ben told us that coding is not maths. I must admit that I didn't quite believe him. However, I think I'm starting to realise that he might have been right. Perhaps coding is about translating the language of imagination, into the language of computers.

Spotlight - Open Processing Link

No comments:

Post a Comment