Nicolas Allemand

Music, game dev and emulation.

Hey !

Another try on my Game of Life simulation: this time, the goal was to make it a little better-looking. It was a great opportunity to get my hands on the wonderful shine library, and to work with tweening libraries (which I didn't use in the final version).

Get it here. :-)

LIFE2 screenshot Yay, shaders!

Screenshot of minesweeper Aw maaaan

A couple of weeks ago, I needed a simple project to test my newest library: signals (to send/receive signals, inspired by the observer pattern), so I decided to make a little minesweeper.
Here's the result, in a couple of evenings of work.

July 26, 1997; Apple introduced Mac OS 8. I remember the long hours I spent in front of my Macintosh, trying the new features of the OS. That's also the first time I had the chance to try HyperCard. One thing really caught my eye: the patterns. Here's a screenshot where you can see the default ones:
Screenshot of Hypercard's patterns window Pretty cool, huh?

I was -and still am- amazed at the ingenuity behind this. The patterns were usually small (17x12 for HyperCard patterns), and only two colours were allowed, yet some of these patterns were awfully complex.
Naturally, I thought this would be a fun idea to re-implement them in a more contemporary engine. I made a little library for LÖVE, which returns a canvas of the desired size, after loading a custom .lua pattern file.

Example of a pattern file:

local p = {}
p.width = 17
p.height = 12
p.data = {2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,}
return p

And how to draw it :

local patterns = require 'patterns'

function love.load()
    canvas = patterns.getCanvas(150, 250, 'my_pattern_file')
end

function love.draw()
    love.graphics.draw(canvas)
end

Finally, here's how the pattern editor looks like:
Screenshot of Pattern Editor app

Here :)

Today I stumbled upon a really cool wikipedia article which deals with a remarkable subject: quadtrees. As it says,

a quadtree is a tree data structure in which each internal node has four children.

Wikipedia

Let me show you an example for you to visualize this:
Screenshot of a quadtree Each node has four children

The implementation is fairly simple, and I wanted to go a bit further. That's when I found koalastothemax. It is a quadtree implementation applied to an image : basically, for each child, you have to compute its colour, which is the average of all the image's pixels colours inside it.

Here's the result:
Screenshot a quadtree-based image
Another screenshot of a quadtree-base image

Hi guys!

Today I programmed a little contamination simulator. The idea came from a programming exercise a friend was trying to solve.

We have a set of particles (500 at the beginning), which have a state (healthy, infected or dead). Additionally, each particle has a lifetime, and can be "stressed" (I'll explain this shortly).

Each 0.2 seconds, a new generation is computed following these rules:

  • infected particles lose some life over time and eventually die (after 14 generations);
  • if there's healthy particles next to infected ones, they have a small chance of being contaminated AND they become "stressed";
  • if a particle is "stressed", it teleports itself to another position in the screen (simulates plane trips, public transports, cars...);
  • if a particle isn't "stressed", we apply a brownian movement to the particle.

You can pause the simulation by pressing the space key.

screenshot It's kinda like The Walking Dead with particles.