Sunday 12 October 2008

D programming on Openmoko

Today I decided to start to write a video game for OpenMoko.

I am a little bit disappointed by all the current available games for openmoko (I like action games). And the port of already existing games that I tried all have poor usability because they are not usable with a touchscreen (A touch screen is much more limited than a mouse, cause you can't move the pointer when you don't click)

So anyway, I wanted to write a very simple game where asteroids are falling from space and you have to destroy them by launching missile from the ground. The control is very simple : touch the screen to fire a missile to the pointed position.

I want the code of the game to be very small and simple, yet fast. I started to write it in vala, but after profiling got a little bit frustrated to see that a lot of time was spent getting and setting gobject properties.

I was about to consider cython + python or C++, and then I found that gdc, the gnu D programming language compiler, was available in the debian distribution for openmoko.

I immediately tried to compile my game guisterax, and it worked fine. Of course no way to play it without the keyboard, but that is great anyway.
D would be a perfect language for embedded applications.

Now the problem is that as far as I know it is not possible to compile D sources using openembedded yet, so I may have to use an other language for my game anyway.

1 comment:

Anonymous said...

You know, that is something that I would ask you to look into. Seeing if you can get D in open embedded... I have been interested in the language for some time now.