Playing About With JavaScript

Playing About With JavaScript

Before Christmas I had a chance to play around with P5.js, the JavaScript library that reinterprets the original goals of Processing for the web. (Processing was developed to enable visual artists, designers and other beginners to learn how to code).

I love playing around with P5.js. It’s a really good way to learn JavaScript. Its learning curve is gentle, it’s highly visual, you get results fast and there are many resources to support learners.

My favourite of these is Daniel Shiffman’s Coding Train Youtube videos. Dan is an incredibly enthusiastic and energetic teacher of coding, with his own unique style. He’s produced hundreds of freely-available videos on a whole host of programming topics.

So, taking inspiration from Dan’s videos I developed a simple sketch (below) in which the fish/jellyfish/stars (I can’t make up my mind what they are) interact with each other (they’re repelled, with the repulsion being proportionate to their size), and interact with the mouse when it hovers over the sketch. (They repelled by it too. Who knew that fish/jellyfish/stars don’t like mice?)