So it turns out, AndEngine is a pain in the neck to learn…

As mentioned on many places around the web, AndEngine’s main disadvantage is that there is no available documentation. Most people also say however that there is a very helpful community out there to support you and provide tutorials to help you along the way. Unfortunately one must bear in mind that the second version of AndEngine (GLES2.0) was released in December 2011, so any tutorials written before that date may contain code that will not work if you are trying to use the latest version of the engine.

So my most of my day has been dedicated to research, and filtering through all sorts of AndEngine stuff on the web. I have been through the whole setup process already to get the engine working on one of the university lab computers (which wasnt easy because the lab systems only have Android 2.1 and 2.2). Thanks have to go out to RealMayo and his set of tutorials. Ive downloaded his copy of AndEngine from github and managed to get it working without too much trouble.

After installation comes the learning process. Now there is a lot of information out there on how to do X and Y with AndEngine, but not much on how to design the architecture of a game. Eventually, I stumbled across Jimmar’s Invaders Clone Tutorial which not only gave me a great understanding of the game architecture in AndEngine, but was also relevant to GLES2.0.

So I had a read, and began coding up my first implementation of TouchMagic. The resultant architecture works as follows:

  1. Create a class which extends BaseGameActivity. This works pretty much like a normal Android activity, so it also needs to be registered in the AndroidManifest.xml file. You set up the Overriden methods as normal, creating a camera and a scene which in most cases will be the opening splash scene for the game.
  2. Create setCurrentScene in your BaseGameActivity. This two lined method handles the swapping of different scenes within the game
  3. Create all the scenes for the game. And then swap between them as required with setCurrentScene.

And that is basically it. BaseGameActivity is used as a controller to administer several different scenes in a game (like the splash screen, main menu, and the game itself). Currently I am unsure why one would want to then have multiple activities within their game, but I may find out why later. As of now though, TouchMagic has a Splash screen, menu screen, and a simple game where one can drag a sprite around the screen. I think its time to call it a day :)


One thought on “Getting Started…

  1. Why have several activites? One I guess is that there are different types of activities available in andengine, so a change might be benefitial for simplicities sake. Also for a lot of people, creating an activity per scene(1 menu activity, 1 game activity etc) is a lot easier as you do not have to deal with scenemanagers in the same way.

    Also, for your ideas(mini-games) you can seperate per mini-game-type variables into different activities.

    With that said, hovewer, having 1 activities, scenemanager, gamescene(with different type of gamescenes for different mini-games) is probably the professional, “nice” way to do it.

    I am using 1 activity and 1 scenemanager, it is quite complicated but also gives you a good seperation of logic!

    *Note, comment made by me is purely my thought and experience of andengien(a few days of programming) so don’t consider it as a truth*

    Keep working, mini-games is always appreciated by me :)

Leave a Reply