Flash Player 11.1 and AIR 3.1 for Android 4.0 Update

So, there’s a new update for Android 4.0 with Flash Player 11.1 and next week it will be followed by a nice AIR 3.1 update.

These introduce full support for Android 4.0 (Ice Cream Sandwich), including the new Galaxy Nexus.

These updates will be available on the Android Market.

For more information please read here.

Random Generated Displacement Map

So,  I was following this tutorial from activetuts+ to create the same effect,  a static distortion effect using the displacement map filter,  in one of my game projects and it was cool until I realized that my project is getting fatter and fatter by adding images of different sizes to use for different sized objects.

Ofcourse, this was not acceptable so I thought I could create a random generated image by code and reuse it than to create different images in Photoshop.

Anyway, here’s the code which is generating a random image to be used with the effect in the tutorial.

function rndImage(w:Number, h:Number, wl:int = 0, bl:int =0):BitmapData
{
var bitmapdata:BitmapData = new BitmapData(w,h,false, 0xDDDDDD);
var randY:int = 0;
var randX:int = 0;
var randW:int = 0;
var thick:Number = 0;
var a:int = 0;
var minWidth:int = 0;
var line:Shape = new Shape();

for ( a = 0; a< wl; a++)
{
thick = Math.random()* 1.3 + 0.2;
randY = Math.random() * h;
minWidth = (40 * w)/100;
randW = Math.random() * (w-minWidth) + minWidth;
randX = Math.random() * ((w-randW));
line.graphics.lineStyle(thick, 0xFFFFFF);
line.graphics.moveTo(randX,randY);
line.graphics.lineTo(randW, randY);
}

for ( a = 0; a< bl; a++)
{
thick = Math.random()* 1.3 + 0.2;
randY = Math.random() * h;
minWidth = (40 * w)/100;
randW = Math.random() * (w-minWidth) + minWidth;
randX = Math.random() * ((w-randW));
line.graphics.lineStyle(thick, 0x000000);
line.graphics.moveTo(randX,randY);
line.graphics.lineTo(randW+randX, randY);
}

bitmapdata.draw(line);

return bitmapdata;
}

And this is how you generate the image

rndImage(width,height, nr_white_lines,nr_dark_lines);

Adobe Flash 11 Stage3D (Molehill) Game Programming Beginner’s Guide book

If you are a flash developer keen to get into game development this book is for you. It is a perfect introduction to 3D game programming in Adobe Molehill for complete beginners.

Starting with simple tasks like setting up Flash to render a simple 3d shape, each chapter presents a deeper and more complete videogame as an example project.

You can get this as a physical book or an eBook.

Source