The “game” we created with my son on Wednesday, DoodleDrive, got a lot of attention and many of you wanted to try it out yourselves. I have now created a new project to Forum Nokia Projects where you can download the binaries (sis for N8, E7, C7… or deb for N900). I also uploaded the source code for the game so you can study how to make a simple game in ~300 lines of QML. Go ahead and start coding your own games now :)
My older son was a bit sick yesterday so I stayed home to be with my kids. As usual kids didn’t know what to do and I came up with the idea if we’d create a simple game with help of latest Qt SDK 1.1 Beta that was released a day ago. …and so we did :) This is a small “documentary” of the process:
I tested how easy it is to create a simple puzzle game with HTML, JavaScript and CSS by creating a new version of my SubBrain game to my Nokia N900 by using Qt Web Runtime.
The idea in the game is to remove all the blocks by clicking block areas of the same color. You’ll need to have at least two blocks of the same color side by side so that they get removed.
I created the SubBrain for my Nokia 7650 several years ago with Java ME. Java ME was a flexible and rapid platform at that time but now after writing the same functionality with plain JavaScript it makes me laugh how easy it is to craft this sort of games with WRT platforms nowadays. And even as Java was (or is?) “write once, run anywhere” platform it doesn’t come to close to WRT where you can develop apps with your browser and text editor and run the same code on your phones.
I used some CSS animations on BlockGo which seem to look nice even on N900. When you select a blocks they fade away nicely. I used jQuery UI’s effect functionality:
$(".b0").effect("fade", {}, 300);
Where “fade” is the name of the effect and 300 is animation time in milliseconds. You can see the effect in action in this demo video:
You can download the game to your Nokia N900 from here. You’ll need to have Qt Web Runtime installed on the device.
JavaScript has been around since 1995 but only since Web 2.0 techniques it has become a mainstream language to all developers. No matter if you are a mobile, server side or desktop developer you probably have touched some JavaScript in your career. Even latest operating systems like Palm WebOS and Google Chrome OS are using JavaScript as “native” programming language.
My first experiences ten years ago with JavaScript were limited only to simple functions like page refreshing or trivial actions when user pressed link or button. In the recent years I’ve been using more advanced features of JavaScript like AJAX. Modern JavaScript frameworks like jQuery have really boosted up the productivity on the UI development.
As a developer you might have read a good advice from Pragmatic Programmer to learn a new language each year. I might say that JavaScript could be my language for 2009 even though I’ve been writing JavaScript nearly a decade.
Game of Othello
As a last JavaScript exercise of 2009 I crafted a small game of Othello by using only JavaScript and small chunks of HTML and CSS. It includes a decent AI opponent which uses minmax algorithm to find a good move. You can find the game here. Let me know if the computer AI can beat you :)
It was a great year of 2009. Looking forward on the new gadgets and technologies of 2010!