Saturday, June 15, 2013

New game "Night Thief" released on Google Play And Samsung Apps

Game powered by LibGDX and Box2D.

Try take away the loot with your car.
Catch objects being thrown from the windows, but remember that the trunk space is limited,
choose most valuable thing!

- Realistic physics
- 2 cities and 64 levels to pass
- 4 unique vehicle and the opportunity to improve their performance (speed, acceleration and capacity)


Monday, June 20, 2011

Solution of problem touch input

First, make sure BaseGameAcitvity implement IOnSceneTouchListener. 
Then add setOnSceneTouchListener(this) to your scene. As you register touch listener on whole scene then no matter where you touch onSceneTouchEvent() will be called.
Then, as a part of the interface IOnSceneTouchListener, you will have to implement an operation

public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {
     .... do stuff 1
     return true; //don't forget this!
     .... do stuff 2
     return true; //don't forget this!
  return false;

To make all works fine, don't forget add "return true", 
if you don't add, then ActionUp does not worked and stuff 2 never execute.

Sunday, June 19, 2011

Removing Activity Label

In manifest.xml file you need to change the theme so there is no title bar


and that needs to be in the activity element 

<activity android:name=".MyMainClass" android:label="@string/app_name"  

Safely detaching a entity from scene

To safely remove a entity from scene on finish path modifier i recommend use EntityDetachRunnablePoolUpdateHandler.

1) Define variable on main class
     private EntityDetachRunnablePoolUpdateHandler detachPoolHandler =  new EntityDetachRunnablePoolUpdateHandler();
2) Register handler

3) Add to onModifierFinished of LoopEntityModifier detaching of shape with use of EntityDetachRunnablePoolUpdateHandler

new LoopEntityModifier(new IEntityModifierListener() {
            public void onModifierFinished(final IModifier<IEntity> pEntityModifier, final IEntity pEntity) {
                EntityDetachRunnablePoolItem edrpi = detachPoolHandler.obtainPoolItem();
                edrpi.set(entity, scene.getChild(0));
                visible = false;
        }, 0, null, new SequenceEntityModifier(new ScaleModifier(0.2f, 1f, 0.1f)));

When the EntityDetachRunnablePoolUpdateHandler gets his next update, the entity is safely removed.

Bands on the background

In andengine standart example you can see bands on the background. The solution of the problem is override onInitDraw when creating Sprite:
 Sprite sprite = new Sprite(0,0,null) { 
        protected void onInitDraw(final GL10 pGL)     {

Saturday, June 18, 2011

Hello everyone, my blog about developing games for android

AndEngine is a free 2D OpenGL Game Engine for the Android platform and I think it's the best variant of engine with to start develop games for Android. Month ago I was start develop my first game. Hopefully soon you will be able to appreciate it.