Alien Eyeball Creature in Space code.
I don’t think this interactive mouse toy would be the same without the colours that have been used in it. It would have been less visually interesting if I had left it with twinkling white stars as it would have been one less layer to discover while playing with it. I wasn’t happy with the irises turning and staying red once the mouse had interacted with an eyeball so now every time the mouse interacts with them they turn the colour which has the opposite value to the current colour. This is a subtle change like the star colours changing as the user is more likely to be engaged with making the eyeballs move around for a while before they notice the change of colours. I think the pupil size expanding and contracting in relation to where the mouse is like this too. Another change to the code has been the inclusion of bezier curves that connect the eyeballs together so they become like an organism of individual yet connected beings in space. Joined together and pulling others into the space to see the odd being in front of them, yet acting individually to the interaction with the mouse. I feel this adds a layer of surprise to the interaction and it is essentially a reward for those who pay attention to small details.
I used only four input methods for the mouse:
- mouseMoved()
- mousePressed()
- mouseDragged()
- mouseReleased()
They can be used individually to invoke their own block of code or “combined” to introduce some novelty into the interaction. These effects will come into play when the user experiments with the interaction via the mouse input.
The mouse interactions are easy to learn, move, press, drag and release. I think the fun of it comes from combining the mouse inputs in different ways, playing with the speed you come at the eyeballs and the small changes in details that you notice over time if you’re engaged with the toy. Leave the eyeballs alone and you notice they have their own movement as well and have a tendency to congregate towards the centre of the screen as if swarming in to watch you. Swipe them with the hand and they get out-of-the-way but they come back to watch you again and every time one dies, there is another to replace it. You can’t get rid of them. They are like flies at a picnic on a hot summer’s day.
So a wee list of effects:
- stars change colour when mouse moves along x-axis
- stars change opacity when mouse moves along y-axis
- moving the mouse pushes the eyeballs away from cursor in the same direction the cursor is moving
- dragging the mouse has a similar effect to moving it except that the eyeballs move in the opposite direction to the cursor
- when the mouse in pressed the eyeballs already on the screen snap to the position of the cursor while new ones continue to spawn wherever they want on the screen
- release the mouse and whatever direction the eyeballs were going in is now reversed and they speed up slightly too
- the pupils of the eyes enlarge or contract in relation to the distance of the mouse from them
- the irises of the eyes change between two colours that have opposite values when the mouse comes in contact with the eye
You may notice that some of the irises don’t appear to change colour, this is because of the use of HSB. For some iris colours the opposite value is the same colour as the current value. Kind of like a wheel.
It would be nice to figure out the eye swivelling and implement that as I think that could look quite nifty. I think perhaps it would be good to have some eyeballs appear to go past the frame before bouncing back in. Other than that, I am happy with the interactivity. I think there is enough going on to retain interest for a while. The eyes have a life of their own when not being played with, which I like. There is a slight creepiness factor to the toy the first time it is played with and that may even happen again if you leave it running and then come back to an organism of eyes eyeballing you. Haha, how cool would motion detection be?! Have them swivel to look at you as you move around. But I also think after playing with them for a bit they become less creepy and slightly cute maybe?….