Integrating Adsense for games into your OpenFL game

I have moved from CPMStar to Adsense for games a month ago and started to earn around 3-5 times more from the same number of clicks/impressions.
Although, it always depends on who plays your games, I suggest to try AFG, if you have such opportunity.

Here is a quick tutorial on how to use AFG with Haxe/OpenFL.

0. “AdSense for games allows you to earn money from your web-based games. AdSense for games uses Google’s Interactive Media Ads (IMA) SDK, the technology used to request ads from within your Flash-based game launcher.”
I have only tried AFG on Flash platform, but IMA SDK also available for iOS, Android and HTML5.

1. Download ima_lib_as3.swc file here: https://developers.google.com/interactive-media-ads/downloads

2. Place ima_lib_as3.swc file in assets folder and add the following line to your application.xml file:

<haxeflag name="-swf-lib assets/ima_lib_as3.swc" if="flash" />

3. Create your Ad Tag at Adsense Dashboard, you can test it here: https://developers.google.com/interactive-media-ads/docs/vastinspector_dual

4. Integrate AFG using this Quick Start Guide: https://developers.google.com/interactive-media-ads/docs/sdks/flash/v3/quickstart
Don’t forget to convert AS3 code to Haxe. 🙂

5. Most likely you won’t see any ads, when you test your game in standalone Flash player.
You have to integrate the game into the web page (and upload it to your website) and set the following flag:

allowScriptAccess="always"

6. If everything’s made correctly you will see ads like in my Rainbow Lines game.

P.S.: One of the requirements for using AFG is to “Have a high volume of games content, i.e., greater than 70% games content with over 2 million games impressions monthly.”
As Google has recently combined Adsense with Admob, your Admob impressions also count. (I suppose 🙂 )


Сколько стоит попасть в топ Google Play

Получил тут письмо от китайцев с интересным предложеним, а именно, предлагают вытащить мою любую бесплатную игру в топ 10 Google Play и продержать её там 5 дней.

Расценки:
Top overall 10 in Canada: USD 20K
Top overall 10 in Germany: USD 30K
Top overall 10 in UK: USD 17K
Top overall 10 in US: USD 75K

Game top 10 in Canada: USD 12.5K
Game top 10 in Germany: USD 20K
Game top 10 in UK: USD 12K
Game top10 in US: USD 47K

Что интересно оплата только после того, как они выведут игру в топ, т.е. это вполне реальные цены, без обмана.
Интересно, 75к окупятся, если в US топ 10 попасть? 🙂


Rainbow Lines

rainbow512x250

Slowing I keep releasing Rainbow Lines game.
I can build the game for almost any platform (not Windows RT, unfortunately), but some bugs and lack of functionality in OpenFL prevent me from releasing it.

So far I have released the game for the following markets:
Rainbow Lines for Kindle Fire on Amazon AppStore
Rainbow Lines for NOOK Tablets on BN App Store

Also, Rainbow Lines is now available online for FREE!

iPad and iPhone version still awaiting moderation.
As for the Blackberry, Windows, Mac and Linux… I will release for these platforms as soon as I fix bugs or find some workarounds.

Huh… next couple of posts I will dedicate to OpenFL/Haxe tutorials. 🙂


Вот так вот

С 3 звёздами, но на первом месте в Amazon Casual Game Downloads.
Фиг их поймёшь почему, видимо цена в $0.99 слишком заманчива. 🙂
amazon_top

И опять на первом месте в NOOK Apps, тоже фиг его знает почему.
А главное без всяких FGL’овских накруток 🙂
nook_top

Куда катится этот мир…


Loading assets from .swf with OpenFL + font embedding

A small tutorial on how to load assets from .swf file with OpenFL.

First, make sure you have the latest version of Haxe and OpenFL.
You can also execute the following command to update your libs to the latest versions:

haxelib upgrade

Second, make sure you have SWF Library, execute:

haxelib install swf

Now, we need to create our SWF library with all the assets.
You can do it with any version Adobe Flash or any other software of your choice.
Creat new flash project, import your assets to the library and make sure that every asset, you want to use, has AS Linkage.

In my example, I have one image with “button” class name:
aslinkage
You should remember class names for all the assets, you will load.
Build .swf file.

Ok, start coding.
Create new Haxe/OpenFL project with FlashDevelop (or whatever you use).
Put your .swf file into assets folder.

Open application.xml file and add the following lines:
1. our SWF Library, so we can use it:

<haxelib name=”swf” />

2. Link to our .swf file:

<library path=”assets/graphics.swf” type=”swf” />

In my case, I have graphics.swf file.
You should remember its name, as you will use it late.

Now we need to load our assets, open your .hx file, where you will load your assets (in my example, it’s Main.hx) and add the following code:

Assets.loadLibrary("graphics", onSwfLoaded); //we load our .swf file by its name "graphics"

After .swf file successfully loaded, we can start using our assets:

private function onSwfLoaded(lib:AssetLibrary):Void
{
	var bmpd:BitmapData = null;
	bmpd = Assets.getBitmapData("graphics:button"); //syntax is [SWF_FILE_NAME]:[ASSETS_CLASS_NAME]
 
	var bmp:Bitmap = new Bitmap(bmpd, PixelSnapping.AUTO);
	bmp.x = 200;
	bmp.y = 100;
	addChild(bmp);
}

The same should work for MovieClips and Sounds.
Worth mentioning, SWF Library doesn’t work for HTML5 target yet.

In order to embed font to you project, we need to do the following steps:
1. Put all the font files into the folder within our project, for example, “assets/fonts/“;
2. Add the following line to application.xml:

<assets path=”assets/fonts” rename=”fonts” />

3. Load and use our font:

var font:Font = Assets.getFont("fonts/arial.ttf"); //load font
var format:TextFormat = new TextFormat(font.fontName, 20, 0xffffff); //create new TextFormat with our font
var text:TextField = new TextField();
text.defaultTextFormat = format;
text.embedFonts = true; //make sure we use our loaded font
text.width = 500;
text.text = "That was easy!";
text.x = 300;
text.y = 400;
addChild(text);

If you build and run sample project, you will see the following result:
result

Sample project source code:
OpenFL_SWF_Font

Have fun! 🙂





Amazon Mobile Ads ANE updated

I have updated Amazon Mobile Ads ANE with the latest version.
It now supports caching and showing of interstitial ads.
In August and September Amazon will provide “a Guaranteed $6 CPM on Interstitial Ads”.
More details here: https://developer.amazon.com/public/apis/earn/mobile-ads

ANE, including source code, could be found on GitHub:
Amazon Mobile Ads ANE

Good luck!


Dolly The Sheep, now everywhere!

I have released Dolly The Sheep game to other platforms, so now it is available at:

Google Play: https://play.google.com/store/apps/details?id=air.com.pozirk.dollythesheep
App Store: https://itunes.apple.com/app/dolly-the-sheep/id887047359
NOOK Store: http://www.barnesandnoble.com/w/dolly-the-sheep-pozirk-games/1119715744
Samsung Apps: http://apps.samsung.com/mars/topApps/topAppsDetail.as?productId=000000863650
Amazon Store (PC): http://www.amazon.com/Pozirk-Games-Dolly-Sheep-Download/dp/B00KI19VYC/
App Store (Mac): https://itunes.apple.com/app/dolly-the-sheep/id890191173


Indie tools

Here is a small list of tools, I’m using in development and in everyday life.
Some of them are well-known, while others are less popular.
Hope, it will be useful to someone.

PuTTY“SSH and telnet client.”
I use it a lot, when I need remotely connect to my VPS.

WinSCP“free SFTP, SCP and FTP client for Windows.”

FlashDevelop“free and open source code editor for every developer.”
One of the best IDEs for developing Flash and OpenFL projects.
And I have recently became a FlashDevelop “sponsor” by donating $100+. Woo-hoo!

HeidiSQL“useful and reliable tool designed for web developers using the popular MySQL server, and Microsoft SQL databases.”
Still has some bugs, but free and works great.

Notepad++“free (as in “free speech” and also as in “free beer”) source code editor and Notepad replacement that supports several languages.”

ShoeBox“free Adobe Air based app for Windows and Mac OSX with game and ui related tools.”
My primary use is to create spritesheets for the games.

Window Movie Maker – yeah, well, simple, easy to use, and free. Just right for me to quickly create game videos/trailers.

Format Factorymultifunctional media converter.

FastStone Image Viewer – similar to ACDSee, but free (for home users, though)

Double Commander“cross platform open source file manager with two panels side by side. It is inspired by Total Commander and features some new ideas.”
And unlike TC, it’s free!

Audacity“free, open source, cross-platform software for recording and editing sounds.”

Inkscape“professional quality vector graphics software which runs on Windows, Mac OS X and Linux.”
Free!

GIMP“GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring.”
Here is a nice article on how to make GIMP even more usable. (it’s in Russian, though)

Trillian“modern instant messaging for home and work that prioritizes chat interoperability and security.”
In case, you want to join #haxe or #openfl channels on IRC.

KeePass“free open source password manager.”
Keeps securing my passwords since 2006! 🙂



Rainbow Lines and etc.

Some news…

* I have released Rainbow Lines on Google Play.
I have decide to make two separate versions of the game: with HD graphics and without, otherwise game file size is too big.

* Updated AdMob ANE to comply with the latest AdMob/Google Mobile Ads/Google Play/AdSense changes. New ANE is much heavier and throws numerous warnings, but seems to work fine. 🙂
Old version is deprecated and “Google Play will stop accepting new or updated apps that use the old standalone Google Mobile Ads SDK v6.4.1 or lower. You must upgrade to the Google Play version of the Mobile Ads SDK by then.”
As usual, it is available on GitHub: https://github.com/pozirk/ANEAdMob

* Match Jong is somewhat in freezed state at the moment, but I have a playable demo, and my artist is ready to start preparing graphics. Going to start working on the game soon. 🙂

* Little by little, I’m releasing free version of All-in-One Mahjong 2 with updated AdMob ANE, of course.
All-in-One Mahjong 2 FREE is already available on Google Play.


DISCLAIMER: The content in this blog represents the opinion of the author. No information here should be used for any purpose except for entertainment.