Simon writing a Matter.js textbook

Simon is currently working on a “Matter.js textbook”, a set of tutorials on how to use Matter.js (a physics library) that he writes on GitHub. Simon writes everything himself, not copying from anywhere. Sometimes he forgets some coding syntax and looks it up in the documentation, but for the rest this is his own text. He explains: “The reason why I am making this textbook is because there are Matter.js tutorials but they are really short and there aren’t many of them. And the only video tutorials are by Daniel Shiffman and they are using P5.js.” If it proves possible, Simon might add video to his GitHub textbook later.

It’s great to observe him type away and when I look over his shoulder, I see that he makes very decent sentences, with a nice tint of humour every now and then.

The link to the textbook:

https://github.com/simon-tiger/matter-js-tutorial/blob/master/README.md

Advertisements

Simon’s Particle Train

Simon made a particle system based on Daniel Shiffman’s latest live stream. Here is the link to Simon’s code on CodePen: https://codepen.io/simontiger/pen/OxvYYW?editors=0010

He also tweeted about it:

Simon Proposes a Community Project in Procedural Design

Inspired by the Processing Community Day projects, Simon came up with an idea to launch his own community project – in procedural design. He used the Coding Train Community Cloud page as inspiration, trying to guess the code used to build it. The videos below show Simon in process of creating the interface.

Simon later presented his project on the Coding Train Slack channel where other members (including Daniel Shiffman) suggested that Simon narrowed down the theme (originally, it was procedural design projects in general and that was too broad). Simon was very upset as he was afraid his “big project” would become too small and couldn’t come up with a theme. Two days later we agreed that he would make several examples for the projects and publish them on the project’s website to give everyone a better idea of what he was looking for.

At the moment, Simon has already published the first example but there seems to be a bug in it, so please view it as work in progress. (Simon originally wrote the code for the Community Cloud project and it worked when he shared it in Processing JS, but on his own project page, using instance mode, the cloud looks like a circle).

Simon writes: Everybody is welcome to contribute to my community project called *Procedural Designs*!
Link to GitHub rep (for this community project: https://github.com/simon-tiger/procedural-designs/ (link to github pages site in the README).

 

 

At Het Pass in Mons (Bergen)

Simon is not really into museums. He prefers to learn things at his own pace and dislikes crowds. The pictures below are from our visit to Het Pass, a science museum in Wallonia, near the French border. The museum is situated in what formerly were mining facilities, the exhibits are interactive, spread out in several oddly shaped buildings connected by industrial bridges and escalators. I believe Simon actually enjoyed the electricity and the genetics rooms, even though the two of us got struck by the electricity from the plasma ball  (painful!):

DSC_1089

DSC_1090

DSC_1098

DSC_1102

DSC_1111

Fractal Trees Customized

This weekend Simon came back to his old fascination, Fractal Trees. This time he didn’t just follow along Daniel Shiffman’s coding challenges, but created customized versions of Daniel’s trees, adding color and physics in some cases or writing the code in object oriented manner:

 

 

 

 

 

DSC_0818

DSC_0819

Evolutionary Steering Behaviors Game

Note: See the update at the bottom of this post!

We’ve had quite a dramatic situation here for the past couple of days, after Simon turned Daniel Shiffman’s Evolutionary Steering Behaviors Coding Challenge into a game in Processing (Java) and then also in JavaScript (with p5). After completing the game in JavaScript, Simon wanted to add a new feature – a checkbox he programmed using the p5.js library. The checkbox would give the player the option to play with or without the timer, adjust the timer and also had a “New game” button. In the end it turned out that the checkbox didn’t really work. Simon was very upset and it took me hours to talk him into putting the game online even though the checkbox didn’t function (he wanted everything to be perfect) and ask for advice. “I have got a problem with a p5 element: In my setup function, I defined my checkbox. In my reset function, my checkbox is undefined. Why?” – Simon asked in the “Share Work” section of the Coding Train Slack channel, where he has the opportunity to communicate with experienced programmers. He received quite a lot of help and was enthusiastic about it at first, but for some reason, he hasn’t tried the solutions he was suggested. Perhaps it’s his gut feeling that the bind function suggested is still too difficult at the moment. I have decided not to push anymore and trust him on this one, although it’s always a dilemma for me whether I should sometimes “force” him into taking instructions from others or let him solely rely on his fantastic intrinsic autodidact mechanisms. The second seems to work better in terms of the learning process, but I do push him into sharing his work.

Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 3Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 4Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 5Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 6Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 7Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 8

Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 2

Simon’s game is online at: https://simon-tiger.github.io/Game_SteeringBehaviorsEvolution/SteeringBehaviours_EvolutionGame_p5/

In the videos below Simon shows how he made the game. It’s an ecosystem type of genetic algorithm (with no generations), where the organisms (autonomous steering agents) clone themselves. The autonomous steering agents evolve the behavior of eating food (green dots) and avoiding poison (red dots). Simon added two invaders into the game, one giving food and the other randomly spreading poison. The player can control the “good” invader by moving him and making new food. The goal of the game is to make the agents survive for as long as possible.

The Processing (Java) version:

The thinking behind the game (Simon explains everything at the whiteboard):

The JavaScript version (now online):

In the last video, Simon talks about his problem with the p5 element.

 

Evolutionary Steering Behaviors game seek algorithm part 1. DESIRED equals TARGET minus POSITION:

Evolutionary Steering Behaviors game seek algorithm part 1. DESIRED equals TARGET minus POSITION 4 Jul 2017

Evolutionary Steering Behaviors game seek algorithm part 2. STEERING equals DESIRED minus VELOCITY:

Evolutionary Steering Behaviors game seek algorithm part 2. STEERING equals DESIRED minus VELOCITY 10 Jul 2017

UPDATE: When Simon saw Daniel Shiffman’s comment on Slack this morning (Daniel saying Simon did a fantastic job and that he might even include Simon’s game in the next Live Stream), he sat down and applied the bind function as suggested by his older peers above – without any incentive on my behalf! And it worked! I think we’ve hit a true milestone again. Simon has this growing feeling that he’s got friends out there, his tribe, who understand and who are ready to help.

One day later: Simon had another chat with his friends on Slack and got a lot of help with the last remaining small bug in his game (the New Game button didn’t start a new game if the player had chosen to play with no timer but jumped to Game Over instead). In the video below, Simon shows how that problem got solved: