"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)

Thursday, 25 April 2013

Fun programming: Java and Slick2D


Many may not believe me but programming can be fun. If you really love programming even watching a XML file going to, or coming, from a remote server can be fun but, of course, if your program produces something funny then programming is also more fun. So, while looking for something to relax after watching too much XML files, I decided to experiment with some 2D game engine. 2D gaming has been for many years confined to the Adobe Flash or J2ME “mini game” context. More recently , with the ever wider smart-phones diffusion, 2D games have known a real revival.
Among the many 2D games engines available I first restricted my choice to the Java-based ones. After a short examining of available features and documentation I decided to try first the Slick2D engine.

Slick2D

Slick2D is a Java game engine mostly based on the LWJGL (Light-Weight Java Game Library) library. The aspect of Slick2D the more appealed to me, and triggered my interest, is the ability to begin coding a simple game by just extending a class and writing three methods.
Slick2D offers in fact an abstract class BasicGame, once this class is extended just three methods have to be implemented:
  • init() : is called once when the game is started
  • render() : is called every time the screen is refreshed
  • update() : is called when controls (keyboard, mouse, joystick, ...) are read
The programmer can mostly ignore the other aspects of the game and concentrate on these three events.
Of course writing a complete game will still be a complex task but, Slick2D makes very simple the initial approach to game programming easing a lot the learning curve at the beginning.

First project

To prepare my first project I first downloaded Slick2D jar file and LWJGL zip archive, I then extracted it in a convenient folder in my home directory. In Eclipse I first made a standard Java application project

Saturday, 30 March 2013

Tuesday, 26 March 2013

Test drive: Ubuntu 13.04 Gnome beta (Live) on the EEEPC 900


I'm definitively a Gnome user. I started my Linux adventure with the good-old Gnome 2. I don't like so much version 3, but I switched to it once I realized it kept, at least in part, its flexibility thanks Gnome shell extensions. I'm actually using Gnome 3 on my desktop computer so, once I heard that Ubuntu was going to have an official Gnome derivative distribution, I started thinking of replacing the Linux Mint 12 installation on my EEEPC 900.

First impressions

The daily-build ISO image I downloaded was quite big (about 958 KB) so that I couldn't use my usual old 1GB USB disk. Not a big problem (I used a 4GB SD card) but I really hope they'll manage to keep the disk image size smaller in the definitive version. Once the SD card have been prepared I rebooted my EEEPC. Ubuntu Gnome boots on the usual featureless default Gnome 3 screen
The side-bar, in the activities screen, appears a little too crowded on the small EEEPC display. This, unlike Unity, means dealing with microscopic icons.

Friday, 22 March 2013

Test Drive: Ubuntu 13.04 “Raring Ringtail” Beta on the EEEPC


As usual, with the coming of Spring, also Ubuntu's upgrade season is coming. I so went on the 'net looking for a beta version to give a look at, just to know what to expect when the real upgrade will arrive.

No beta version?

I was a bit startled to learn that beta versions has been released only for derivative distributions while, under new distribution policies, main Ubuntu only goes through a “freeze” period of bug-fixing. I had so to download a “daily-built” version to make my bootable USB disk.

First impressions

Here is the new Ubuntu first screen-shot
apart from some slight graphic change there aren't many changes at a first glance, anyway the new Unity is still fluid and responsive even on my good-old EEEPC 900.

Sunday, 10 March 2013

Bodhi Linux … Age of Enlightenment?


While reading around the net about new Linux distributions I got into some good reviews about a distribution I never heard before: Bodhi Linux and about its default window manager Enlightenment.
Body Linux is a Ubuntu based distribution, currently at its release 2.2.0. Among the other things Bodhi uses Enlightenment as default desktop manager; currently at its release 17 Enlightenment is a lightweight desktop which promises fancy graphics even on not-so-powerful machines.
All this has been more than enough for me to download Bodhi ISO image, place it on my USB disk and go on with another “test drive”.

Bodhi Linux (live) on the EEEPC

Bodhi Linux boot has been quite fast, it started in less than two minutes (from a computer and disk combination that isn't very up-to-date). In the middle of the boot process I've been asked for the desktop profile and theme I would like in my system. The choice is not definitive since you can change later any aspect of the desktop but if you choose the one that best fit your needs you'll have a good starting point for configuring your desktop.
I did choose the “Netbook” profile Here is how it looks like