So many ideas, so little time.

All-Peaks Solitaire in beta

September 16th, 2016
All-Peaks Solitire Beta version of All-Peak Solitaire game is already available for online player at my website.
I have already finished with graphics and sfx as well as background music.
So far only game ha only 4 layouts, but I’m going to add more soon.

Admob OpenFL Extension

February 25th, 2015

As I moved from Flash (Adobe Air) to OpenFL, the same I’m doing with extensions.
First extension, Admob OpenFL Extension could be installed with haxelib:

haxelib install admob-openfl

Full source code and usage instructions could be found on GitHub:
Admob OpenFL Extension

Unfortunately, extension supports only Android, so if anyone wants to add iOS support, please let me know!

з.ы.: Amazon Ads extension is coming soon… 🙂

Loading assets from .swf with OpenFL + font embedding

August 26th, 2014

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.

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

July 30th, 2014

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!

Indie tools

May 27th, 2014

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! 🙂

Amazon Mobile Ads ANE

November 12th, 2013

As I’m going to release free versions of Solitaire and Mahjong games on Amazon AppStore, I’ve decided to use Amazon Mobile Ads (+ AdMob of course, Amazon Mobile Ads only work in USA, I guess).
And, as these games are made with Adobe Air, I had made another ANE…
Here it is: Amazon Mobile Ads ANE, available on Github along with source code.

Publish Adobe Air app to Mac App Store

November 3rd, 2013

I have mainly used this guide, it is in Russian and written for Air3.6, also it was updated with my comment about Air3.8.
There is very similar guide in english, but also for Air3.6: http://pigsels.com/2012/04/air-app-store-publishing-guide/

The differences for Air3.8 (maybe for Air3.9 as well) are:
– Following three line are not required anymore:

1
2
3
codesign -f -v -s APPLICATION_CERTIFICATE bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/1.0/Resources/adobecp.plugin
codesign -f -v -s APPLICATION_CERTIFICATE bundle.app
codesign -f -v -s --entitlements entitlements.plist bundle.app/

– Instead you need to use this:

codesign -f -v -s APPLICATION_CERTIFICATE --entitlements entitlements.plist bundle.app/

Some extra things, that might be useful:
– If your app connects to the internet, you need to add the following lines to your entitlements.plist:

<key>com.apple.security.network.client</key>
<true/>

All the possible sandbox keys could be found here: https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW1

– You can verify, that your app is correctly signed like this:

codesign -v --verify bundle.app

– Take note, that icons file’s name, generated by Air is “Icon.icns” and not “icons.incs”, so you may end up having two files, just mention correct one in your Info.plist.

– Launch your app and check that name in top menu matches the title of the app. In my case they were different, thus game was rejected. See screenshot.
mahjong_mac

AdMob ANE

September 2nd, 2013

I have found one AdMob ANE, it works ok and supports both Android and iOS, but it has bugs and lack some functionality:
http://code.google.com/p/flash-air-admob-ane-for-ios

So, had no choice but create my own AdMob ANE.
Extension along with all the source code is available on GitHub:
AdMob ANE

Node.js

August 25th, 2013

As a back-end for Solitaire and Mahjong games I’m using a separate VPS with Node.js, as a web server, and MySQL database, which I’m hoping to switch to MariaDB some day.
I really like Node.js, it can handle thousands of connections at once on a cheap VPS for ~$10/month.
On July 12 2013, All-in-One Mahjong was promoted on Amazon App Store as a Free App of the Day, and game had ~100k active players a day. But Node.js had absolutely no problems with that, even 512MB of memory was enough.

I’m very new to Node.js, so here are some links, that helped me to know it better:
Manual and Docs: http://nodejs.org/api/
Node.js driver for MySQL: https://npmjs.org/package/mysql
Some tuts: http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/
Forever: http://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever

Application Licensing ANE

May 4th, 2013

I have published paid app on Google Play and Samsung Apps, so I have used there licensing services in order to protect the game from illegal copying (DRM).

In order to use these services with my current AIR apps, I have developed by own ANEs.
The source code along with extensions and some usage examples can be found on Github: ANE License Checker

I’m also going to publish the game on SlideME, so will add support of their licensing service later.

Luckily, Amazon and B&N has built-in protection, that is applied when you publish your app, no need to make extensions for them.