Hi, In our one of the previous post about adding box2d objects in game we created all the box2d bodies in the initialization phase and during the game we were just making the sensor objects (removing their collision response) so that they acted as if they were not present. We added a custom flag to…
Category: Tutorials
Showing Dialog in Libgdx Android
Hi, In this small post we would write on how to show android dialogs in libgdx code. It is pretty simple. We used dialogs when we had some processing going on or while changing screens. Create A Dialog: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:orientation=”vertical” > <ImageView android:id=”@+id/imageWaitDlg” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:src=”@drawable/pleasewait” android:contentDescription=”@string/waitString” /> </LinearLayout>…
Customizing View Adapters in Android
This tutorial is a more general tutorial, focussing on an Android UI aspect that can be used in games as well as other apps. View Adapters are a useful feature which allow us to reuse UI skeletons. The official Android documentation does not give a detailed description on how these can be used / customized….
Moving Platforms in Box2d in a Specified Path
Hi, In one of the previous post we moved a platform from a point A to point B and then back to point A and so on. In this post we would expand on it and move it in specific path which has more than 2 points which we find in many platformers like mario…
Integrating Open Feint in Android
Hi, In one of the previous post we had mentioned how to integrate Scoreloop in Android. This time we would be talking about integrating Open Feint as in our game Balloon Shooter we had used open feint for global scoreboard. First make an account in Open Feint and add a game to it. You would…
Box2d/Libgdx Example Code
Hi, We are uploading source code of a simple box2d-libgdx example. Here is the FileĀ In the attachment you would find three projects :- BoxLibgdxExample BoxLibgdxExample-desktop BoxLibgdxExample-android UPDATE :- The example now contains box2d debug renderer also which can be used to render box2d objects. Copy them in your eclipse workspace and import the projects in…
Moving Platforms in box2d
Hi, In this post we would me making moving platforms in box2d. In most of the games especially platformers we have these moving objects which would go on a specific direction for a fixed distance and come back. A Static Rectangular Platform: First we will make a simple platform which would be static and can…
Arrows And Bullets in Box2d
Hi, This will be a small post in which we would make a bullet or a projectile which can be added to a game. Most of the games have some sort of ranged weapon or an enemy having ranged weapons throwing bullets, arrows etc. Making a Bullet: We would consider AR-10 rifle kits bullet to…
Using Box2d in Libgdx Game Part III
Hi, In this post we would make a box2d object manager to handle creation/deletion of objects. First we would make some changes in the BaseBoxObject class made in the last post to add option of deleting an object from the world and also an abstract function to draw the texture which would have to be…
Using Box2d in Libgdx Game Part II
Hi, In our last post we used box2d to make a body and attach a fixture to it. Then wrote fixed step update function to update the box2d physics in the game. Now we would attach a texture to the body. While attaching we take care that the texture is of similar shape to the…