Looking for a little game prototype / code snippets in SWI-Prolog


I am looking for a little game prototypes / code snippets in SWI-Prolog.

The requirement is just:

  1. A game loop, which calls a update every 0.016ms.

  2. A get_keyboard_state like interface, which can get keyboard state (i.e. check a key state up/down).,

  3. A graphics interface, which allow me to draw some squares in the canvas.

Since I have no prior experience for developing graphical interactive applications in Prolog, can anyone give me some guidance ? (code snippets / prototypes would be nice)

Very Thanks.

P.S. Performance is not necessary.

Anne does

Ludum Dare is an online event where games are made from scratch in a weekend. Check us out every April and October!

The code for some of them can be found at

Thanks. I have not dig into these remarkable projects. It seems that they use web technology which is a bit difficult for me.

I am using plOpenGL.

Although it’s a bit weak compared to other mature game engines or multimedia libraries, I believe it’s a good starting point. It would be nice if SWI-Prolog can provide SDL bindings.

Other possible directions:

  1. gnuprolog-libsdl2

  2. xpce

but I haven’t explored them yet.

P.s. Still waiting for better solutions.