Simon solved the bug in his Bit Invader game!

Simon actually managed to solve the bug in his Bit invader code! This is a game he was translating from Codea into JavaScript, we have already published a blog post about it here.

The project is available on Simon’s page in Codepen:

In the two videos below Simon explains what the bug was (he had forgotten a “break” statement). He insisted I include both videos, but actually only the second one is informative:


Simon still needs to add explosions to this game (make the enemies explode), so there will probably be a follow-up on this one.


Translating Bit Invader from Codea into JavaScript

Simon tried to reconstruct Bit Invader game (from in JavaScript, but got stuck at a certain point when he was programming the enemy to recognize the hero and the bullets. Here is how far he got. The project is available on Simon’s page in Codepen:


RGB Project in Codea using SVG Color Map

On Monday this week Simon spent hours converting hexadecimals into RGBA values for the 140 colors supported by all modern browsers and creating a color file in Codea. He used the w3schools color map available at and an html color codes converter 

Some of the color names were quite exotic (like Chartreuse or Bisque ), and we looked those up together in the dictionary. We also took a very close look at the relation between red, green and blue values and found out that red was added every time to make colors lighter, even in shades where you would not expect any red.

Simon later made a nice design pattern in Codea using the color file:



Diffusion-Limited Aggregation translated into Codea

Simon translated Daniel Shiffman’s Diffusion-limited Aggregation Coding Challenge into Codea. The coding challenge explores the generative algorithm “Diffusion-Limited Aggregation”, whose visual pattern is generated from random walkers clustering around a seed (or set of seed) point(s).

Unfortunately, every time the iPad falls asleep the application seems to stop, so we never got a sizable tree.


For Mom’s birthday 

For my birthday, Simon made me some Fireworks:

He made them look even better the following day, by adding trails:

The code is Simon’s translation into Lua (the language of the Codea app) of Daniel Shiffman’s Fireworks Coding Chalenge (JavaScript).

We’ve also thoroughly enjoyed our birthday weekend at Brugge and especially Knokke. Fine to discover such fabulous beaches in the neighborhood. Simon loves water. Perhaps, because it is somehow related to the fluidity and of his mind and because of the freedom water provides to his body.

Box2D into Codea, Java into Lua

Several recent translations of Box2D examples (from Daniel Shiffman’s book The Nature of Code) into Codea, that is Processing (Java) into Lua. Both Box2D and Codea are physics libraries.


Revolute Joint (Windmill):


Translating examples from The Nature of Code into Lua (Codea)

This morning Simon attempted to make a more difficult translation in the Codea app of an example from Daniel Shiffman’s book The Nature of Code (Java) into Lua. It concerned the Gravitational Attraction example from Chapter 2 of the book, Forces. Simon is happy with Codea because “It’s really readable!”, “You don’t need semicolons and parenthesis!” and all logic operators are actually typed in words (“and”, “or”, “not”).


Unfortunately, the function Simon introduced as substitute for mouse pressed release on the touch screen didn’t seem to work:

Simon did successfully translate the simple harmonic motion example from Chapter 3, Oscillation: “I use trigonometry!”

For this example, he had to look up a complex formula for mapping a range to another range on the internet b1 + (s – a1)*(b2 – b1)/(a2-a1) “because map function doesn’t exist in Codea, so I wrote that function”.

Swapping the axes: