Sunday, September 29, 2013

How to create Android Games (.apk file) with HTML5?

I have just updated my list of how to create Android Games, with the newly added HTML5! Yes, i really mean using HTML5 to create Android Games in the format of .apk file which can be uploaded to the Google play store or other app stores. For those who are HTML or HTML5 savvy, I know you have yearned for this possibility. Why learning other languages (such as Java, Lua, Actionscript, etc) while you are already an expert in HTML5? Here, I would have some demo in this post.

Creating Android Games with HTML5 has been made possible and intuitive with the Intel XDK. FYI, the Intel XDK came from the acquisition of AppMobi. It can be downloaded for FREE. In fact, the Intel XDK can be used to create games which are compatible for iOS too.



The XDK is in the format of .jnlp. By following the instructions, you are able to setup the project folder containing the necessary javascript files after registering a new account on the fly. By default, it will use the localhost and port number 58888 as your emulator (better in Chrome browser).


Now, inside the emulator, click "START NEW" to create a new project:


Select "Create a new game app" and Click "Next". Then, to have a reference point, you can choose "Start with an Ejecta*-based Jump and Run sample" and click "Next". Rejoiced, you will reach the screen below:
Basically, you can have a taste on how good / smooth the game is. However, the demo isn't ended yet. Now click the 'Build for app store' (Build only) icon at the toolbar.

 You will reach the appcenter of Intel from where you can build your HTML5 games into an apk file.


Choose "Android Build Test" and click "Build App Now"

Congratulation! You have created an Android Game apk file with Intel XDK successfully! Easy right? Let's start creating Android Games with HTML5!

Wednesday, September 25, 2013

How to handle Back button event in Starling Framework?




When creating mobile games featuring intensive user interactions in Android, it is normal to notice that the players have a higher tendency to touch the back button (or the menu button) which is outside the region of your designed GUI. By default, the back button on the Android devices would immediately minimize your games' UI, without any warning. This is especially unfavorable when the player who intends to 'go back' to the previous game map, finally ends up having his home page popped up, and the game play experience is ruined.

Hence, it is a good practice to handle Back button event properly in Starling Framework. Below shows the necessary code snippets:

1. Import flash UI keyboard and keyboardEvent:
import flash.ui.Keyboard;
import flash.events.KeyboardEvent;
import starling.core.Starling;

2. Add an event listener in your main starling class:
Starling.current.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);

3. Handle the Back button event with e.preventDefault function:
private function keyPressed(e:KeyboardEvent):void
{   
     if(e.keyCode == Keyboard.BACK)
     {
          e.preventDefault();
          e.stopImmediatePropagation();


          trace("Back button is pressed");
     }           
}

       

Tuesday, September 24, 2013

Where to download the free Ratebox Adobe ANE for Android?




When you reach this post, let me guess, you must have been spending the last few hours hunting for something like free "Rate My App" Adobe ANE to be used in the Android (with Adobe AIR actionscript).

At the same time, you have pretended not noticing the RateBox Mobile Extension ANE due to the obvious price tag $19.99. Furthermore, you may have temporarily overlooked the Rate App Air Native Extension as you wish you might get one with a much lower price or even a FREE Adobe ANE for the feature of "Rate My App" or "Rate this App". And finally, you could have been strongly determined that getting one that works in Android shouldn't charge any as there is one open source iRate that performs greatly in iOS.

HOWEVER, be ready to brace yourself... There ISN'T any free "Rate this App" Adobe ANE for
Android, at least at the time of writing.

Upset? You are not alone. As mentioned in my previous post, developing Android games with the Adobe AIR is sometimes frustrating.

Solution? I will update the post as soon as I found out the treasure. In the meantime, you are encouraged to create the feature of "Rate this app" by yourselves, since it isn't a very tough one.

Where to download the free Twitter Adobe ANE for Android?



One of the problems faced when developing Android Games with the Adobe AIR AS3 is that, most of the useful Social Networks and the Mobile Ads Networks companies do not officially release the framework or the libraries that integrate into the Adobe AIR. More often than not, the developers could either refer to the Adobe official sites which categorizes the Adobe Native Extension (ANE) into the commercial and the non-commercial group. In some cases, you may need to send a 'special request' to the customer support (eg: Vungle, Startapp) in order to get one.

In terms of the Facebook ANE, we are lucky that someone has produced a free and working one in github. But how about Twitter? Where to look for a Free yet working Twitter ANE for Android?

To our dismay, at least at the time of writing, there isn't any free Twitter ANE around from the search engine.

HOWEVER, there is a working Twitter API for Adobe AIR Flex Mobile project. Right, it is only for the Flex Mobile project, but not the Actionscript Mobile project. (T.T)

Anyway, I will update this post once I come across a working one. Stay tuned.

Monday, September 16, 2013

Why Candy Crush Saga Game could be so popular and successful?




No matter you like it or not, the Candy Crush Saga Game by King.com is really really a golden example of a successful mobile game that tops the chart in terms of the downloads and the popularity.
Ok. The simplest fact is, it reaches the downloads of beyond 100,000,000 (100 millions), and is still counting day by day. Regardless of what types of advertising or in-app selling approaches, this company must have earned crazily.

The thing is, what makes Candy Crush Saga Game so special? It is just using a simple concept of match-3 game. Remember the PopCap game Bejeweled that was once so widespread in the facebook last time? Both of them apply the same concept. And the subsequent Candy Crush Saga Game is still able to penetrate the market so successfully. Why?

To make it short, here's shows some convincing facts about the Candy Crush Saga Game.

1. Simple Game Play Experience

Candy Crush Saga only requires the player to match 3 or above candies of the same type. With the touch play experience, it is even more intuitive and easier than playing with the mouse. The game has overcome the boundary of ages, genders, countries and ethnics. Anyone seeing the game would be able to pick up fast, and complete each round within minutes.

2. Almost endless stages (beyond 400)

Candy Crush Saga always updates its number of stages. Since the game is designed to be platform-based, the number of stages could always be increased with some complexity added. For example, it takes a few more times to break the jelly, or to collect more fruits in a single stage, or to achieve higher scores with fewer moves. Technically speaking, it can go almost endless, as long as the developers wish.

3. Social Network boosted (Facebook)

Candy Crush Saga game has a very critical element to which the success of the game attributes - widespread through Facebook social network. To surpass the barriers of the entry of some stages, you need to request tickets from your friends (through Facebook). Furthermore, if you fail to complete the stages for more than 5 times in a row and do not want to waste too much time on the regeneration, you can request the moves from your peers. In the end? More and more of your friends help spreading the game while joining it.


In short, even though the Candy Crush Saga is not a graphic-intensive game, it still stands out successfully, defeating any other Android Games due to the elements of simplicity, endless rounds and the dissemination through the social network.