Good News!
To all the Adobe AIR developers (both iOS and Android), here's a FREE and always updated Admob Native Extension (ANE) by Code Alchemy.
In fact, I have a post previously that talks about how to import the Admob ANE into the Flash Builder 4.7 properly. But the thing is, this time, at the time of writing, the Open Source Codes of the Admob ANE provided by the Code Alchemy has indeed included everything you need - Sample Project + Native Source Code! Pretty Cool huh?
Basically, you just have to import the Sample Project and start getting your hands wet in testing out all the available features. There is one impressive thing to mention here - the author has made everything so intuitive! Change Banner position, Banner Type, Interstitial Ads and etc. Customize the Admob to suit your app!
Apart from the full-fledged Adobe ANE that works perfectly both in iOS and Android, the author is always available for feedback and future enhancement. Drop him a message and he will respond with useful answers and help.
I wish there are more generous people like him to make our lives easier, as an Adobe AIR app developer. :)
Android Gamify - a place to share everything about Android Games, especially Android Game development and Android Game Play.
Showing posts with label Adobe AIR. Show all posts
Showing posts with label Adobe AIR. Show all posts
Monday, August 18, 2014
Saturday, June 14, 2014
Google Play "Security Alert: You are using a highly vulnerable version of OpenSSL"!
Seriously, the Gmail message with this title "Security Alert: You are using a highly vulnerable version of OpenSSL" freaked me out yesterday. Below shows the details of the message:
I am sure I am not the only one suffering from this 'threatening' message. A quick search brings me to this Adobe AIR forum thread. From my understanding of the discussion in the forum, it is the inconsistency of the OpenSSL version in the apps that triggers this unfavorable announcement. As noticed,
What is worse is that, Google Play doesn't provide any timeline info about how long the buffer is before taking any action. Meanwhile, the Adobe AIR staffs couldn't promise an exact date for another stable and problem-free release. THAT MAKES THE CHAOS!
We realize the potential harms due to the outdated OpenSSL applied, and the urgency to update the apps as soon as possible. However, at the same time, we hope the Google Play could be more polite and transparent in conveying the message to us. For example, which apps are affected? And what is more disturbing is that, we have no idea whether the OpenSSL issue could be be caused by other dependencies such as the third-party Adobe ANE.
What to do now? Let's keep our finger crossed and hope the Adobe AIR could update us as soon as possible...
Update on 2014-06-20
The latest Adobe AIR 14.0.0.125 with the updated OpenSSL 1.0.1h is available NOW. Although it is a beta version, it has at least solved the "Security Alert" issue.
Hello,
One or more of your apps is running an outdated version of OpenSSL, which has multiple security vulnerabilities. You should update OpenSSL as soon as possible. For more information about the most recent security vulnerability in OpenSSL, please see http://www.openssl.org/news/secadv_20140605.txt.
Please note, while it's unclear whether these specific issues affect your application, applications with vulnerabilities that expose users to risk of compromise may be considered “dangerous products” and subject to removal from Google Play.
Regards,
Google Play Team
I am sure I am not the only one suffering from this 'threatening' message. A quick search brings me to this Adobe AIR forum thread. From my understanding of the discussion in the forum, it is the inconsistency of the OpenSSL version in the apps that triggers this unfavorable announcement. As noticed,
OpenSSL 1.0.1 SSL/TLS users (client and/or server) should upgrade to 1.0.1h.However, at the time of writing, the Adobe AIR 14 only deploys the OpenSSL 1.0.1g, which is still potentially not the qualifying version. Meaning? Most of the Adobe AIR developers are affected.
What is worse is that, Google Play doesn't provide any timeline info about how long the buffer is before taking any action. Meanwhile, the Adobe AIR staffs couldn't promise an exact date for another stable and problem-free release. THAT MAKES THE CHAOS!
We realize the potential harms due to the outdated OpenSSL applied, and the urgency to update the apps as soon as possible. However, at the same time, we hope the Google Play could be more polite and transparent in conveying the message to us. For example, which apps are affected? And what is more disturbing is that, we have no idea whether the OpenSSL issue could be be caused by other dependencies such as the third-party Adobe ANE.
What to do now? Let's keep our finger crossed and hope the Adobe AIR could update us as soon as possible...
Update on 2014-06-20
The latest Adobe AIR 14.0.0.125 with the updated OpenSSL 1.0.1h is available NOW. Although it is a beta version, it has at least solved the "Security Alert" issue.
Thursday, May 29, 2014
Flash Builder 4.7 Error: "dx tool failed"
The annoying bugs of Flash Builder 4.7 continue apart from my last post.
This time, the Flash Builder 4.7 throws me this error message: "dx tool failed" while I try to perform the Export Release Build, as shown in the picture below:
The thing is, every thing works properly in the debug mode. The error message only appears which you are packing the application.
The wild search from the search engine doesn't bring me too far. I haven't modified anything critical, except Remove and Add back the necessary SWC file before packaging. It definitely has nothing to do with the corruption of JRE.
Finally? I restart the computer. And the "dx tool failed" error disappears. Right. It is another workaround that doesn't bring any insight to the root of the error...
Can anyone tell me what has happened?
This time, the Flash Builder 4.7 throws me this error message: "dx tool failed" while I try to perform the Export Release Build, as shown in the picture below:
![]() |
"Error occured while packagin the application: dx tool failed" |
The wild search from the search engine doesn't bring me too far. I haven't modified anything critical, except Remove and Add back the necessary SWC file before packaging. It definitely has nothing to do with the corruption of JRE.
Finally? I restart the computer. And the "dx tool failed" error disappears. Right. It is another workaround that doesn't bring any insight to the root of the error...
Can anyone tell me what has happened?
Tuesday, May 27, 2014
Flash Builder 4.7 Error: "Initial Content not found"
When developing mobile games in Flash Builder with the Adobe AIR, i come across this horrifying error that wasted my hours: "initial content not found", as shown in the picture below.
This error takes place when i try to change the app name (<filename></filename>) in the xml. Then, no matter how many times i clean and rebuild the project, the above error still appears. One of the observations is that, the .swf file in the bin folder disappears and will never be generated again.
I am writing this post as the current search engines still do not have a clear solution on this (I have tried a number approaches as suggested but still fail). Apart from that, this seems to be an old issue that already happened in the previous version of the Flash Builder.
In the end? i have no choice but to re-create a new project (copy and paste everything) in order to solve this "initial content not found" error. I know this is a lame workaround. And I really wish someone could correct me if i am wrong...
Saturday, May 24, 2014
Monopoly Deal Mini Game Update: Double The Rent Card added
Still remember the game Monopoly Deal Mini? It has been a while since i last updated it. Recently a new card has been added - Double The Rent.
What does the Double The Rent card do? And most importantly, how to use it?
Here, it is intuitive to say that, the card would raise the rent amount for 2 times. To use it, there are 2 conditions to be fulfilled here:
a) Use any Rent Card
b) Two or more action points left.
Since "Double The Rent" card is itself an action, it is only feasible if you have sufficient action points left (you own 3 action points for every new turn). Hence, when you use the rent card, it will automatically pop up to ask whether you want to double your rent amount, as shown in the picture below.
Note, you need not drag the Double The Rent card to the center table. Just perform the rent action as normal, it would alert you if you have sufficient action points left.
What does the Double The Rent card do? And most importantly, how to use it?
Here, it is intuitive to say that, the card would raise the rent amount for 2 times. To use it, there are 2 conditions to be fulfilled here:
a) Use any Rent Card
b) Two or more action points left.
Since "Double The Rent" card is itself an action, it is only feasible if you have sufficient action points left (you own 3 action points for every new turn). Hence, when you use the rent card, it will automatically pop up to ask whether you want to double your rent amount, as shown in the picture below.
Note, you need not drag the Double The Rent card to the center table. Just perform the rent action as normal, it would alert you if you have sufficient action points left.
Tuesday, May 6, 2014
Adobe AIR app does not support Intel Android devices, yet!
Ok, I am not trying to make the Adobe AIR developers (or potential developers) panicked or something. But it should be emphasized that, the Android Games or Android Apps developed (packaged) with the Adobe AIR are not working in the Intel devices (x86-based mobiles phones or tablets), yet!
I only came to know this a while ago. My father is using an Intel-based Acer mobile phone. However, whenever i try to download and install my published Adobe AIR Android games from the app store, it has never been successful. The thing to point out is that, the app is download-able, but not install-able. To recap, i mention that an Adobe AIR app has a minimum size of 10MB per apk file. That would mean that, the users from an Internet-not-so-accessible area have to tolerate the malfunctioning app or game after the efforts to download it. I can imagine their frustration which results in 1-star rating for sure... -.-
Anyway, in case you experience the same on your Intel Android devices, don't get too mad as you are not alone!
Apart from that, there is a good news from the Adobe. Research has been done on making the future Adobe AIR SDK more robust.
Simply can't wait that.
I only came to know this a while ago. My father is using an Intel-based Acer mobile phone. However, whenever i try to download and install my published Adobe AIR Android games from the app store, it has never been successful. The thing to point out is that, the app is download-able, but not install-able. To recap, i mention that an Adobe AIR app has a minimum size of 10MB per apk file. That would mean that, the users from an Internet-not-so-accessible area have to tolerate the malfunctioning app or game after the efforts to download it. I can imagine their frustration which results in 1-star rating for sure... -.-
Anyway, in case you experience the same on your Intel Android devices, don't get too mad as you are not alone!
Apart from that, there is a good news from the Adobe. Research has been done on making the future Adobe AIR SDK more robust.
Simply can't wait that.
Thursday, April 17, 2014
Adobe AIR VS Haxe. Which is better for creating Android Games?
![]() |
Adobe AIR VS HaxeFlixel |
If you use FlashDevelop before, in the New Project menu, you will notice that there are a number of project types available to create Android Games. However, which one is the best one?
Here i would like to compare Haxe and Adobe AIR.
I came from Actionscript 3 background, have been using Starling Framework for Android Games with the Adobe AIR. It has been so far a great experience. But recently I start considering an alternative due to some reasons.
1) Adobe AIR App File Size is too BIG
Due to the nature of the Adobe AIR, there are two options of building Games:- Export Application with captive runtime
- Export Application that uses a shared AIR runtime
Meanwhile, the second option does solve the file size issue, but it requires the users to install an additional plug-in. As you can expect, although it is only an one-time installation, the requirement of the additional plug-in would drive the user away.
2) Adobe AIR requires a third-party Adobe Native Extension (ANE)
The Adobe Native Extension (ANE) itself is actually a convenient element. However, the important Social network platform such as Facebook or Twitter, and the Mobile Ads Network like Admob DO NOT officially provide the Adobe Native Extension for you. As the native Android is in Java, to apply those features, you have to rely on the ANEs instead, which are created by some Samaritans out there (if you are lucky enough to find them). This begets one issue: inconsistent update. I do not blame the ANE creators. But the rapid development of Android, Facebook, Adobe AIR, or etc would cause the version conflicts if the ANE are not updated in time. If you come from the native Java programming before, you will definitely understand the scenario.Is Haxe + Flixel + OpenFL a good alternative?
Recently, HaxeFlixel is a common term. It is still young but it seems promising with the active community. From the official sites, there are a number of sample projects (+ source codes) with demo for beginners.
I have personally attempted the HaxeFlixel. First, the file size issue doesn't appear as noticed when using the Adobe AIR. However, the initial setup is horribly tedious. It isn't hard to make a work-able Android Game actually. But still, it requires a bit of a learning curve.
Apart from that, there is a critical drawback - lack of an Android debugging emulator/simulator. If you have tried Eclipse IDE before, you may find that, the real bottleneck of creating Android Game is the debugging process. The matured IDE such as Adobe Flash Builder comes with both Android and iOS simulator. The debugging process will come in handy with simply a few buttons. However, with HaxeFlixel in the FlashDevelop, it is a different story. Technically, you have no choice but to compile the apk file first before testing it on your device or the third-party tool such as BlueStacks. Although the codes are debug-able in the Flash platform first, different platforms may behave differently. (and hence, you can't deduce that a game which is working on the Flash is also working in the Android device)
So back to the question - Which is better out of Adobe AIR and Haxe (or HaxeFlixel)?
I couldn't provide a solid answer here. But at the moment, i still embrace Adobe AIR, for its stability and the awesome Starling Framework. At the same time, i will keep an eye on the HaxeFlixel, and start learning it to see how far i can go with this alternative.
Friday, February 28, 2014
Running Man Rock Scissors Paper Game is in the Google Play Store Now!
Yay! The Running Man Rock Scissors Paper Game is now available in the Google Play Store!
As the RM maniacs, we all know that there are 2 types of Rock Scissors Paper Games which are popular in the Running Man Variety Show:
a) Ka-wi Ba-wi Bo (가위 바위 보)
b) Muk-jji-ppa (ë¬µì°Œë¹ )
Something to note is that, this Running Man Rock Scissors Paper Game has no offense to any RM member. The stats is simply based on personal opinion.
Also, since a number of users don't like the Adobe AIR 4.0 plugin, this game is using the Adobe AIR 3.7. Before the awareness of the Adobe AIR 4.0 is getting popular, we would only use the lower version.
As the RM maniacs, we all know that there are 2 types of Rock Scissors Paper Games which are popular in the Running Man Variety Show:
a) Ka-wi Ba-wi Bo (가위 바위 보)
- A normal Rock Scissors Paper Game. Ka-wi (scissor), Ba-wi (rock), Bo (paper).
b) Muk-jji-ppa (ë¬µì°Œë¹ )
- This is a Korean modified Rock Scissors Paper Game (eg: Refer Episode 147).
- To play this Muk-jji-ppa game, there are at least 2 rounds.
- In the first round, it is a normal Rock Scissors Paper.
- The winner of the first Round has to make the opponent's hand same as him/her in the second round in order to win the Muk-jji-ppa
- If there isn't a winner in the second round, the process is repeated.
Something to note is that, this Running Man Rock Scissors Paper Game has no offense to any RM member. The stats is simply based on personal opinion.
Also, since a number of users don't like the Adobe AIR 4.0 plugin, this game is using the Adobe AIR 3.7. Before the awareness of the Adobe AIR 4.0 is getting popular, we would only use the lower version.
Sunday, February 23, 2014
Flappy Bird Algorithm Part 4 - An Android Game Demo (Floppy Balloon)
With the previous Flappy Bird Game Algorithm, I believe you would be able to come out with something similar.
So, here is my published version of the Flappy Bird - Floppy Balloon.
In the Floppy Balloon, i have made the game relatively simpler. And there are 2 modes: Easy and Hard. In the Easy mode, the forward speed of the balloon is slower, and the interval of the obstacles is longer, and you only get 1 score after going through 1 barrier. While in the Hard mode, the pace is increased and you will be rewarded 2 scores for each obstacle that you go through.
Again, to remind that there is a need to perform a 'one-time-only' installation of the latest Adobe AIR app.
Any feedback is welcome~
So, here is my published version of the Flappy Bird - Floppy Balloon.
In the Floppy Balloon, i have made the game relatively simpler. And there are 2 modes: Easy and Hard. In the Easy mode, the forward speed of the balloon is slower, and the interval of the obstacles is longer, and you only get 1 score after going through 1 barrier. While in the Hard mode, the pace is increased and you will be rewarded 2 scores for each obstacle that you go through.
Again, to remind that there is a need to perform a 'one-time-only' installation of the latest Adobe AIR app.
Any feedback is welcome~
Thursday, February 20, 2014
Flappy Bird Game Algorithm Part 3 - Collision Detection
So far we managed to make an object flying smoothly with the adjustable gravity and the forward speeds.
Next, it comes the major part of the game: Obstacles generation and Collision Detection
Note that the obstacles (tunnels/pipes) can be generated in the similar ways as the background movement. Now the thing is, how to know if our flying object hits them?
To put it in a better picture, let's have a look at the analogy below:
Here, to investigate whether the object hits both the pipes (upward and downward), it is to check whether the object is not successfully contained 'inside' the green box region (on the right side).
With this understanding, we only require a few information to complete the task:
a) Coordinates of the flying object + its Width and Height
b) Coordinates of the green box region + its Width and Height
Luckily, the Width and the Height of the object and the green box are constants. All we need to perform, is a fundamental collision checking, as shown in the function below (Again, it is inside the onEnterFrame function):
Straightforward enough. Hopefully with these ideas, you can design and customize the Flappy Bird Game in anyway you want.
Next : Flappy Bird Game Algorithm Part 4 - An Android Game Demo (Floppy Balloon)
Next, it comes the major part of the game: Obstacles generation and Collision Detection
Note that the obstacles (tunnels/pipes) can be generated in the similar ways as the background movement. Now the thing is, how to know if our flying object hits them?
To put it in a better picture, let's have a look at the analogy below:
Here, to investigate whether the object hits both the pipes (upward and downward), it is to check whether the object is not successfully contained 'inside' the green box region (on the right side).
With this understanding, we only require a few information to complete the task:
a) Coordinates of the flying object + its Width and Height
b) Coordinates of the green box region + its Width and Height
Luckily, the Width and the Height of the object and the green box are constants. All we need to perform, is a fundamental collision checking, as shown in the function below (Again, it is inside the onEnterFrame function):
public function collisionDetection(_obj1:FlyingObject, _obj2:GreenBox):Boolean
{
//*Note that my flying object is pivoted in the center
//check if it is within the pipes
if(_obj1.x + obj1.width/2 >= _obj2.x &&
_obj1.x + obj1.width/2 <= _obj2.x + _obj2.width)
{
//hit upper pipe
if( _obj1.y - _obj1.height/2 <= _obj2.y) return true;
//hit lower pipe
if( _y1 + _obj1.height/2 >= _obj2.y + _obj2.height) return true;
}
}
{
//*Note that my flying object is pivoted in the center
//check if it is within the pipes
if(_obj1.x + obj1.width/2 >= _obj2.x &&
_obj1.x + obj1.width/2 <= _obj2.x + _obj2.width)
{
//hit upper pipe
if( _obj1.y - _obj1.height/2 <= _obj2.y) return true;
//hit lower pipe
if( _y1 + _obj1.height/2 >= _obj2.y + _obj2.height) return true;
}
}
Straightforward enough. Hopefully with these ideas, you can design and customize the Flappy Bird Game in anyway you want.
Next : Flappy Bird Game Algorithm Part 4 - An Android Game Demo (Floppy Balloon)
Flappy Bird Game Algorithm Part 2 - Background movement
With the ability to make the gravity, now let's enable the background movement.
Just FYI, in the Flappy Bird Game (or any spaceship game), it is the background that moves at the opposite direction which causes the illusion that the main object is flying. It is the typical way of creating such an effect.
Here, i am taking a Super Mario-like background image from here. To make it move smoothly at the back, we need at least 2 background images, which i crop the originals into 2 pieces, as shown below (bg1 and bg2):
At the beginning, the first part of the image (bg1) is shown (filling the device), while the second part (bg2) is placed just after the first image.
Then, with the Event.ENTER_FRAME again, both background images are moved slowly to the left. When the bg1 is completely vanished from the screen, its location (x) is moved to the end of the screen again. The same process is repeated to the image bg2 as well. And the entire process is looping forever.
Not surprisingly, in the onEnterFrame function of the background object, the function is as brief as below:
Next: Flappy Bird Game Algorithm Part 3 - Collision Detection
Just FYI, in the Flappy Bird Game (or any spaceship game), it is the background that moves at the opposite direction which causes the illusion that the main object is flying. It is the typical way of creating such an effect.
Here, i am taking a Super Mario-like background image from here. To make it move smoothly at the back, we need at least 2 background images, which i crop the originals into 2 pieces, as shown below (bg1 and bg2):
![]() | ||
Bg1 and Bg2, each pivoted at the top left red point. |
At the beginning, the first part of the image (bg1) is shown (filling the device), while the second part (bg2) is placed just after the first image.
Then, with the Event.ENTER_FRAME again, both background images are moved slowly to the left. When the bg1 is completely vanished from the screen, its location (x) is moved to the end of the screen again. The same process is repeated to the image bg2 as well. And the entire process is looping forever.
Not surprisingly, in the onEnterFrame function of the background object, the function is as brief as below:
private function onEnterFrame():void
{
this.x -= GamePlay.GAME_SPEED;
if(this.x < -DEVICE_WIDTH) this.x = DEVICE_WIDTH;
}
{
this.x -= GamePlay.GAME_SPEED;
if(this.x < -DEVICE_WIDTH) this.x = DEVICE_WIDTH;
}
Next: Flappy Bird Game Algorithm Part 3 - Collision Detection
Wednesday, February 19, 2014
Flappy Bird Game Algorithm Part 1 - Gravity and flying
Normally, to create the games involving Physics (eg: gravity), the use of Physics Engine such as Box2D would be a boost for complicated run-time computations. However, in the Flappy Bird game, since the only requirements are to:
- Make the bird fly upwards while touching
- Make the bird fall while not flying (with gravity)
Here, to remind, I am using AS3, Starling Framework and a latest version of Adobe AIR (4.0).
First, I am taking the advantage of Event.ENTER_FRAME to allow the flying object to animate/fly on each frame. In the onEnterFrame function, a gravity is implemented. At the same time, we allow the player to touch any space on the device to activate a 'jump'.
private const UPWARD_SPEED:int = 5;
private const MAX_FLOOR:int = 800; //an indication that it hits the ground
private const GRAVITY:Number = 0.5;
private var objFlying:FlyingObject = new FlyingObject();//and addChild
private var speed:Number = 0;
private var isJump:Boolean = false;
private function onEnterFrame(e:EnterFrameEvent):void
{
if(isJump)
{
speed = -UPWARD_SPEED; //negative relative to the normal gravity
isJump = false; //once a jump is activated, we disable the flag
}
speed += (GRAVITY); //physics ya, the speed is affected by gravity
objFlying.y += speed;
if(objFlying.y > MAX_FLOOR) //if it hits the wall
{
speed = 0;
objFlying.y = MAX_FLOOR;
}
}
private function onTouch(e:TouchEvent):void
{
...
var touch:Touch = e.getTouch(stage);
if(touch.phase == TouchPhase.BEGAN)
{
isJump = true; //a touch enables a slight jump
}
}
private const MAX_FLOOR:int = 800; //an indication that it hits the ground
private const GRAVITY:Number = 0.5;
private var objFlying:FlyingObject = new FlyingObject();//and addChild
private var speed:Number = 0;
private var isJump:Boolean = false;
private function onEnterFrame(e:EnterFrameEvent):void
{
if(isJump)
{
speed = -UPWARD_SPEED; //negative relative to the normal gravity
isJump = false; //once a jump is activated, we disable the flag
}
speed += (GRAVITY); //physics ya, the speed is affected by gravity
objFlying.y += speed;
if(objFlying.y > MAX_FLOOR) //if it hits the wall
{
speed = 0;
objFlying.y = MAX_FLOOR;
}
}
private function onTouch(e:TouchEvent):void
{
...
var touch:Touch = e.getTouch(stage);
if(touch.phase == TouchPhase.BEGAN)
{
isJump = true; //a touch enables a slight jump
}
}
Note that the upward speed, gravity and the floor location are tunable according to your needs. With the Event.ENTER_FRAME, the animation is an easy job.
Next: Flappy Bird Game Algorithm Part 2 - Background Movement
How to create the game like Flappy Bird?
Flappy Bird, another popular game based on the 'simplicity', topped the chart not only in the Apple App Store, but also the Google Play Store before it was removed.
From the perspectives of the game play experience, the Flappy Bird is designed to challenge the consistency of the distance judgement of the players, with very high accuracy. Only 1 Hit Point, one highscore and infinite tries, no Mana Point, no magic, no checkpoint, no multiplayer.
From the views of the game development, the Flappy Bird simply relies on the gravity for the movement, and a simple collision detection while the background is moving at a linear speed.
To be honest, I have no idea why this game becomes so popular, other than the 'simplicity'. And yes, after the tutorial on the Match 3 Game last time, here i would like to create this similar game myself, out of the curiosity. To summarize, i divide the game algorithms into several parts:
a) Flappy Bird Game Algorithm Part 1 - Gravity and flying
- Alright, no box2d or other libraries. Only a few lines of codes will do.
- Is trivial as well. Just need a good image.
- A simple algorithm used to detect the collision of the object with the tunnels/walls.
- Apart from the basics, let's demo a self-customized version
- I would be using other images to replace the original Flappy Bird.
- The game requires the Adobe AIR 4.0. You need to upgrade it if prompted.
Adobe AIR 4.0: Why do you need to upgrade?
Recently, the Adobe AIR has a major update to 4.0. It was supposed to be a very exciting news along with its useful new features. However, since the latest update of my games (and apps), i noticed that there is a significant increase in the stats of uninstall rates. This affects all my games such as Minipoly Deal, Running Man Quiz, Guess Car Brands, Quoridor, etc. Then, i was bombarded with a number of emails acknowledging me about the worry of 'installing another Adobe AIR 4.0'. It is mistaken as an intrusive plug-in that might damage the smartphones...
Hence, i think there is a dire need to raise the concern by writing this post, in order to comfort all the users and the would-be players of my games - Adobe AIR is a runtime system that enables the packaging of the codes into native applications. It is a requirement for the mobile platforms to play the games developed through Adobe Flash. And the Adobe AIR 4.0 has made the games/apps compatible with the latest iOS 7 and the Android 4.4 (KitKat). The details of the change log is here.
The thing that intrigues the users is that, unlike the previous updates, the Adobe AIR 4.0 has been made compulsory to be installed as an another app separately. This 'additional' action keeps the users away, as they fear that it might be harmful.
In order to further convince that Adobe AIR 4.0 isn't a detrimental app, I would like to emphasize that, it is only a one-time installation. With it, you would be able to play other games made by Adobe Flash. Furthermore, the Adobe AIR 4.0 has made the game package size much smaller compared with the previous versions. It is in fact a great advance after the updates.
Then you might be asking - Why other games don't require this? It is simply a matter of Games tools selection. As mentioned in my previous post, Adobe AIR AS3 comes with powerful framework which enables the game creation in a very productive way. That's it.
I hope you would at least feel relieved after reading this.
Monday, December 16, 2013
Sound effect resources for Android Games
In case you are wondering where to look for free sound effect resources for Android Games, here i have a recommended link.
There are 3 main reasons i pick this sound effect resources instead of the others:
I believe most of us are not sound engineers, so having this resource would be definitely a helpful one.
Note: If you are going to load the sound effects into the Flash Builder, remember to perform the up-sampling / down-sampling the frequency of the audio files with the appropriate software, as mentioned in previous post.
There are 3 main reasons i pick this sound effect resources instead of the others:
a) Resourceful solutions
The different types of sound effects are categorized clearly at the left, listing:- Pickup/Coin - eg: Mario Coin
- Laser/Shoot - eg: Space shooter
- Explosion - eg: tower defense bomb
- Powerup - eg: RPG level up
- Hit/Hurt - eg: Streetfighter / King of fighter attack
- Jump - eg: Mario jump
- Blip/Select
- Randomize
- Mutation
b) Intuitive and flexible
By clicking the button, it will generate a sound effect of your choice. Each click will generate a different sound. Basically you can perform unlimited clicks until you hear the one of your favorites. Furthermore, Each sound effect generated is tunable with a number of attributes:- Attack Time
- Sustain Time
- Punch
- Decay Time
- Compression
- Frequency
- Frequency cutoff
- etc ....
c) Free for all
If there is a Facebook "Like" button, or a Google "+" button, i won't be hesitating to share this to all my friends. You can easily export all the sound effects generated for free. YES, you are not reading the typo. There are really some Samaritans out there researching and creating free products for us!I believe most of us are not sound engineers, so having this resource would be definitely a helpful one.
Note: If you are going to load the sound effects into the Flash Builder, remember to perform the up-sampling / down-sampling the frequency of the audio files with the appropriate software, as mentioned in previous post.
Thursday, December 5, 2013
How to set the frame rate in the Flash Builder Actionscript project?
In some of the games such as Tower Defense or RPG, a consistently high frame rate is necessary to maintain a smooth display of the animations. By default, an Actionscript project in the Flash Builder has a frame rate of 25. This is barely enough for a few movements on the screen. If there are tonnes of bullets or enemy armies bombarding the screen display, the players will experience a horrible game play experience (and most importantly, rate your game badly....)
So, setting the game frame rate is necessary. To do that, you need to include a simple SWF meta tag above your class definition (and AFTER your library import), as stated below:
In the code, make sure you have your SWF meta tag written just before your Class. Here, a frame rate of 60 is chosen. Apart from the frame rate, you can set other configurations as well, such as width, height, background color, etc.
One thing to note is that, the effect of the frame rate "may not" be reflected if you are in the debugging mode with the Adobe AIR simulator. Therefore, don't be surprised if you still observe some lagging when debugging the game. Everything will be alright when you "Export Release Build".
So, setting the game frame rate is necessary. To do that, you need to include a simple SWF meta tag above your class definition (and AFTER your library import), as stated below:
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Rectangle;
[SWF(frameRate="60", width="640", height="960",backgroundColor="0xffffff")]
public class YourGame extends Sprite
{
public function YourGame()
{
....
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Rectangle;
[SWF(frameRate="60", width="640", height="960",backgroundColor="0xffffff")]
public class YourGame extends Sprite
{
public function YourGame()
{
....
In the code, make sure you have your SWF meta tag written just before your Class. Here, a frame rate of 60 is chosen. Apart from the frame rate, you can set other configurations as well, such as width, height, background color, etc.
One thing to note is that, the effect of the frame rate "may not" be reflected if you are in the debugging mode with the Adobe AIR simulator. Therefore, don't be surprised if you still observe some lagging when debugging the game. Everything will be alright when you "Export Release Build".
Wednesday, November 27, 2013
How to handle multiple resolutions / multiple screen sizes with the Starling Framework?
One of the great reasons that i choose Adobe AIR and Starling Framework as my favorite tool to create Android Games is that, it can be easily customized to support multiple resolutions for multiple screens. Honestly, if you are going to design and re-size every single image of your games for all the Android devices, it is going to make your life much more miserable...
So, actually the complete guide to support multiple resolutions is stated clearly here, which includes the 3 strategies:
a) Stretching the stage
b) Letterbox
c) Smart Object Placement
In this post, particularly, I will demo a quick and an easy approach - Stretching the stage. Just in case you are still getting stuck with the guides, here's a simple working solution for your reference (which i actually use it in all of my games :))
public class myGame extends Sprite
{
private var mStarling:Starling;
public function myGame()
{
super();
// support autoOrients
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var screenWidth:int = stage.fullScreenWidth;
var screenHeight:int = stage.fullScreenHeight;
var viewPort:Rectangle = new Rectangle(0, 0, screenWidth, screenHeight)
mStarling = new Starling(Game, stage, viewPort);
mStarling.stage.stageWidth = 640;
mStarling.stage.stageHeight = 960;
// set anti-aliasing (higher the better quality but slower performance)
mStarling.antiAliasing = 1;
// start it!
mStarling.start();
}
}
What is actually done is that, in the codes, i have defined my default device to be a screen with the width = 640px and the height = 960px (ratio w:h = 2:3). With this, all my game elements (buttons, background images, etc) would be designed based on this resolution. Then, if the game is loaded into a device with a different screen size (and pixel density), the Starling would help me re-size accordingly. It could be a compromise, but it will effectively save you a lot of time.
Isn't that easy and convenient compared to that in the Java Eclipse?
So, actually the complete guide to support multiple resolutions is stated clearly here, which includes the 3 strategies:
a) Stretching the stage
b) Letterbox
c) Smart Object Placement
In this post, particularly, I will demo a quick and an easy approach - Stretching the stage. Just in case you are still getting stuck with the guides, here's a simple working solution for your reference (which i actually use it in all of my games :))
public class myGame extends Sprite
{
private var mStarling:Starling;
public function myGame()
{
super();
// support autoOrients
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var screenWidth:int = stage.fullScreenWidth;
var screenHeight:int = stage.fullScreenHeight;
var viewPort:Rectangle = new Rectangle(0, 0, screenWidth, screenHeight)
mStarling = new Starling(Game, stage, viewPort);
mStarling.stage.stageWidth = 640;
mStarling.stage.stageHeight = 960;
// set anti-aliasing (higher the better quality but slower performance)
mStarling.antiAliasing = 1;
// start it!
mStarling.start();
}
}
What is actually done is that, in the codes, i have defined my default device to be a screen with the width = 640px and the height = 960px (ratio w:h = 2:3). With this, all my game elements (buttons, background images, etc) would be designed based on this resolution. Then, if the game is loaded into a device with a different screen size (and pixel density), the Starling would help me re-size accordingly. It could be a compromise, but it will effectively save you a lot of time.
Isn't that easy and convenient compared to that in the Java Eclipse?
Sunday, October 20, 2013
How to save data/records of the Android Games in Adobe AIR AS3?
Throughout the game play (either Android Game or others), the player's record is important to be always updated in order to let him/her continue the previous checkpoint. From the complicated RPG Games (levels, equipments, cash left, etc) to the simple mini games (high score, number of attempts, number of stages unlocked), records are necessary so that the players need not start all over again every time they engage the game.
In fact, the feature of saving data/records of the Android Games in Java is available here. The question is, how to implement the same thing in Actionscript 3?
1. import flash.net.SharedObject
The code which is similar to the SharedPreferences in Java is the "SharedObject". To use it, you need to import the flash library.
import flash.net.SharedObject
2. Define a SharedObject variable and a Record name
Define a variable named "shared" at which the records would be stored. You can provide any "RECORD_NAME" to create a shared object.
private var shared:SharedObject = SharedObject.getLocal("YOUR_RECORD_NAME");
3. Define your data in Object datatype and store it inside the 'data'
The "data" member of the SharedObject is nothing different from the datatype "Object" - an associative array. You can easily define your records in "Object" datatype before storing it.
For example, to store the levels, hit points, mana point of a character, the codes would be as below:
shared.data.characterData = {"level":5, "hit_point":100, "mana_point":100"};
In short, it isn't hard to have a data saving feature in your Android Game. So, next time when designing the game architecture, remember to have this feature included.
In fact, the feature of saving data/records of the Android Games in Java is available here. The question is, how to implement the same thing in Actionscript 3?
1. import flash.net.SharedObject
The code which is similar to the SharedPreferences in Java is the "SharedObject". To use it, you need to import the flash library.
import flash.net.SharedObject
2. Define a SharedObject variable and a Record name
Define a variable named "shared" at which the records would be stored. You can provide any "RECORD_NAME" to create a shared object.
private var shared:SharedObject = SharedObject.getLocal("YOUR_RECORD_NAME");
3. Define your data in Object datatype and store it inside the 'data'
The "data" member of the SharedObject is nothing different from the datatype "Object" - an associative array. You can easily define your records in "Object" datatype before storing it.
For example, to store the levels, hit points, mana point of a character, the codes would be as below:
shared.data.characterData = {"level":5, "hit_point":100, "mana_point":100"};
In short, it isn't hard to have a data saving feature in your Android Game. So, next time when designing the game architecture, remember to have this feature included.
Saturday, October 19, 2013
How to solve "unsupported sampling/frequency" of audio files in AS3 (Starling Framework)?
As mentioned in the previous post, it is pretty straightforward to load audio/sound files in Starling Framework. But the thing is, it is annoying to learn that the adobe Flash Builder only allows to import the audio files that are recorded in the multiple of 11kHz (11kHz, 22kHz, 44kHz). And if it is not, you will get the error similar to the message below:
So, how to solve this "unsupported sampling/frequency" issue? (we are not sound engineers right?)
At the moment, I suggest using a third-party audio editor software, such as GoldWave to manually edit the sampling rate of your audio/sound files. (I personally hope that someone would make a browser-based version of that functionality)
To use the GoldWave, you could simply open your audio/sound files with it, and "Save as" a file in the "mp3" format, choosing any option which is in the multiple of the 11kHz frequency. (Here, i pick Layer-3 (LAME), 44100 Hz, 128kpbs, stereo.)
Once you have saved it, you can re-embed your audio/sound files again. :)
Description:
- Internal error in outgoing dependency subsystem, when generating code for ... : java.lang.NullPointerException
- The frequency 0 is not supported in file....
So, how to solve this "unsupported sampling/frequency" issue? (we are not sound engineers right?)
Solution: Manually down-sample/up-sample the audio/sound files
At the moment, I suggest using a third-party audio editor software, such as GoldWave to manually edit the sampling rate of your audio/sound files. (I personally hope that someone would make a browser-based version of that functionality)
To use the GoldWave, you could simply open your audio/sound files with it, and "Save as" a file in the "mp3" format, choosing any option which is in the multiple of the 11kHz frequency. (Here, i pick Layer-3 (LAME), 44100 Hz, 128kpbs, stereo.)
Once you have saved it, you can re-embed your audio/sound files again. :)
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.
Subscribe to:
Posts (Atom)