Tag Archive: Game


Checkers Redux is out now!

The wait is finally over, we have just unleashed our new checkers game on Android, GetJar and LGWorld marketplaces. Here’s the game’s description:

“Here comes the rebirth of one of the most played and entertaining board games on earth; The Checkers!

Play in Single player mode with your phone or in Multiplayer mode with your friends. Track your past performances against your phone and become a Checkers/Draught Master!

Play on Beach, on Leaves, on Paper and with Smileys (all selectable themes, more to come in future versions)

Choose from 4 difficulty levels. From Beginners to Advance level players, this game is for all. Challenge your inner Checkers/Draughts player to beat the phone in the best possible ways!

Intuitive touch controls make it easy to play checkers on your phone, just tap a piece and then tap where you want it to go. If you accidentally hit the wrong spot, the undo buttons let you take back your move and try again.”

Checkout the video after the break!

Here are the Android Market Links:

Paid: https://market.android.com/details?id=excelarz.games.checkersRedux.paid

Free: https://market.android.com/details?id=excelarz.games.checkersRedux.Free

Advertisements

The wait is finally over, we have just unleashed our new checkers game on Android, GetJar and LGWorld marketplaces. Here’s the game’s description:

“Here comes the rebirth of one of the most played and entertaining board games on earth; The Checkers!

Play in Single player mode with your phone or in Multiplayer mode with your friends. Track your past performances against your phone and become a Checkers/Draught Master!

Play on Beach, on Leaves, on Paper and with Smileys (all selectable themes, more to come in future versions)

Choose from 4 difficulty levels. From Beginners to Advance level players, this game is for all. Challenge your inner Checkers/Draughts player to beat the phone in the best possible ways!

Intuitive touch controls make it easy to play checkers on your phone, just tap a piece and then tap where you want it to go. If you accidentally hit the wrong spot, the undo buttons let you take back your move and try again.”

Checkout the video after the break!

eXcelarz Interactive has just launched a new game on Windows Phone 7 Marketplace. Here’s the link to their blog post:

http://www.excelarz.com/blog/?p=322

Finally, I have managed to incorporate the Singleplayer game option in Checkerzzz. For the AI, i used my own algorithm which can be termed as a subset of existing decision tree based algorithms. I have added some randomness factor into it so the user will experience different behavior from the AI every time he/she plays. The AI will also make mistakes sometimes like real players do or it will not gonna let you win otherwise.

I have also launched this version on the Android market (version 1.1), so anyone out there who wants to try it out can download it from there and upgrade their existing version.

Checkerzz has crossed the 1000 mark a couple of days back in terms of Download Count. The overall rating is still around 4.5 with much demand for single player gameplay. I have finished working on it and will be launching the new version shortly. 

After getting a somewhat strong feedback from the Android market (the download count, as of now, has crossed 700 figure in less than a week) and through a number of suggestions that were received, I have decided to rollout an update for Checkerzzz that will include the SinglePlayer game mode. The update is currently under development and I plan to launch it as quickly as I can, most probably by the end of this weekend.

Finally, the game has been launched on the Android Market and is now available for download for free. Special thanks to all my friends and colleagues (especially Rambler and Mx) who consistently backed me up and kept encouraging me all the way 🙂

The gameplay video is pasted here again for quick reference 😛

Keeping my fingers crossed! 🙂

Menu System is an important part of a game, no matter which platform you want to target. Same is the case with Android and I found the platform flexible enough to facilitate any such requirement. While developing my first game, i too got into multiple approaches while i was searching for the best (and of-course ‘easier’ ;)) way to develop a menu system for my game. I found some ways on different forums that involve making an activity for each menu screen. This has some advantages but I personally didn’t like this approach. Finally I found a way, through some experimentation, that was more understandable (for an indie PC game developer, like me) and is described below:

1. Create a layout file (.xml) for your menu screen just like you do to create any other screen and place some controls on it. You can add as many screens as you want using this way.

2. Now you have to modify your game activity class to initialize these layouts using View objects. You can either keep separate variables for each view or you can declare and array of views and initialize them all.

image

3. The currentView variable is an index that determines the view that should be passed on to the activity to show on the screen.

4. Now initialize your view depending on its type. You must use the LayoutInflator class to get the view object that you want to store.

image

This is a simple utility function that takes a layout resource id and returns the required view object.

5. Write event handlers for your controls in each layout in your activity class and use the currentView variable to determine the next view to show.

6. Now you can use the setContentView(View) function in your event handlers to switch to the next screen by using currentView index and using it in allViews array. Look at the sample call below:

image 

7. Optionally, you can pass parameters among these views by utilizing the view.setTag(object) function and passing it a custom parameter class instance.

This way, you can think of your whole game as a single activity (just like a PC game) and switching between screens as required. I don’t assume that this approach is the best one out there and i look forward for some positive feedback on this.

The starting point of any game project is writing a game loop. This is one of the most integral and crucial part of any game, whether small or large. So it must be given due attention and one should choose the most appropriate and optimized way of doing it.

The Android game programming is no exception and there are several ways of managing and writing this game loop. Here I’ll discuss some approaches that I found in SDK samples and other resources (excluding OpenGL part). There are some basic steps to follow before writing these game loops.

The first step is to create your own View or Layout by extending an existing Layout or View (like LinearLayout or SurfaceView). Then override its onDraw method to control the rendering over this surface. The general concept is, that you call some update function that calculates the dynamics of the new frame and then post an invalidate command that ultimately forces the View to draw itself, hence creating a simple basis for drawing and refreshing the objects on this surface.

1. Using TimerTask and Timer

One way of creating this loop is to extend the LinearLayout class and override its onDraw function. Then add a Timer object in the child class. Look at the code chunk below:

image

You then need to write some functions to start/stop this timer. They should look something like below:

image

The schedule function of the timer object takes a TimerTask object and the time after which the Timer task is run. Here the UpdateTask is a custom class that extends the TimerTask and overrides its run function.

image 

The postInvalidate function forces the View to redraw itself and the update function is a local function that you have to write yourself (you can name it anything) to calculate game’s next frame.

2. Creating a Custom Handler

This scheme is used in the Snake game that comes with the SDK’s samples. In this approach, you create a custom class by extending the Handler class and overriding its handleMessage function. The custom handle should be written inside you game view so that it can access the update and invalidate functions of your view. The child handler class should look like this:

image

Now you need to create an instance of this class in your game view class and then call its sleep function from your method that you will use to update your game’s frame. In the code snippet above, the sleep method calls some internal message handlers to make sure that the message is sent and handled appropriately. To find out more details about this approach, refer to the Snake game that comes with SDK samples.

3. Using SurfaceView, SurfaceHolder and a Custom Thread

This approach is considered more appropriate if one wants to write a game that is more real-time. Some SDK samples like LunarLander and JetBoy also implement this technique.

This method use the SurfaceView class to create its main game view class. The game view class in turn needs to handle the SurfaceHolder call back and then use it to get the underlying canvas which can be used to carryout the required drawing routines.

All the core game logic is written in the custom thread that uses it’s overridden ‘run’ method to update the game objects and redraw the view. This method contains a while(true) type of loop that repeatedly calls the drawing and updating routines. To draw the game objects, the method uses the SurfaceHolder’s lockCanvas method to get the underlying canvas object and then uses that object to do the drawings.

This approach doesn’t use the view or layout’s onDraw method and hence doesn’t require calling the invalidate method as the other two approaches do. Instead it clears the screen itself by calling the Canvas object’s drawBackground or drawColor routines.

Since there’s no delay or wait time mechanism in this approach, therefore, it allows the system to do the update and draw processing as fast as it possible increasing the refresh time of the game’s frames.

This wraps up the post here. I hope it is helpful for those seeking out to develop games on the Android platform.

Here’s the ‘teaser trailer’ 😛 or a gameplay video of my first Android game. This all started off with some experimentation with the platform, eventually been developed into a full game having mutliplayer game option (for now) and a working menu system :D. All graphics programming is done using the core graphics functions of the Android SDK.

The first version of this game will be available to download from Android market soon. After that, i will start working on the newer version which would have some additional (hopefully exciting) features. 🙂