e3roid example: Score handling – displaying the score

Something nearly every classic game needs, is the display of a score. A simple text doesn’t look “game like” – so a normal “textsprite” wasn’t my choice for displaying the score.

In this article you find my implementation a score-display class for e3roid based on animated sprites. I could also have used “TiledSprites”, but I still have the vision of letting the numbers change with animation – but I haven’t started implementing this yet.

To use the source code below you first need a e3roid body. Best is to extend the code of the Tutorial “Handle touch events” on the e3roid-page. If you follow the instructions below, the course will be increased with each touch-action.

Here you see how a sample coding could look like:

Continue reading

Game Engines: Including the the first game elements in my Android project

The next step after setting up an Andorid project was to include the first game relevant elements into a prototype. The target is to put multiple moving or animated graphics (sprites) and paint them into a canvas that will regularly be displayed on the screen. To accomplishing this, a nice class hierarchy has to be created to easily handle and organize sprites.

By coincidence i stumble over two freely useable 2d game engines, which handle exactly these topics – and even more. I have had a detailled look at both engines. Here you find a short summary of my experiences, that I’ve made with these engines:

e3roidhttp://www.e3roid.com

E3roid is a relatively easy to learn 2d game engine for the Android. There are a lot of example source code available that perfectly describes the way to use the engine. There is a good Tutorial in the e3roid-Blog available, which makes the start even more easy.

Basic functionality is in addition to sprites and animated sprites also an easy menu-function and the support for so called “Tiled-Maps”, which helps you in building game-worlds quite easy.

Andenginehttp://www.andengine.org/

Andeninge is, like e3roid, a 2d game engine for Andorid. The engine seems to be more difficult to understand as e3roid. Many functionalities are quite similar to e3roid (because e3roid is been inspired by Andengine in some places). But it’s not only more difficult, but also looks more professional and complete than e3roid. Additional functions in Andeinge are for example: Audiosupport, a* (a-star) algorythm for path-finding on tiled maps, and a multi-touch onscreen controller.

The Andengine-Community is very active, so that you can quickly find solutions for your problems or get some inspiration by others.

My conclusion:

Who prefers to have a quick start should have a look at e3roid. You can have nice results within a short time. Especially if you are new to the topics, I’d really recommend to use this engine.

If you prefer the more professional way and you require a more complete game engine, you should prefer to use Andengine. The more difficult start-phase will soon be rewarded when more complex questions arise.