Tom Krcha's FlashRealtime

Hey amigo!
I am Tom Krcha, Gaming Evangelist at Adobe. These are my notes


What Creative Suite 5.5 brings to game developers

April 13th, 2011

Building games for mobile devices with various operating systems is one of the biggest challenges for developers. Creative Suite 5.5 makes it easier and allows you to deploy games that run across Android, BlackBerry Tablet OS, and iOS. You can also test your game with different resolutions and DPIs using device profiles in Flash Builder. In Flash Pro, you can rescale content to any screen-size just by ticking one checkbox and so on…

As a game developer CS5.5 brings to you are not only new export options, but also tooling that is tied to mobile publishing and helps you to do things faster.

Let’s have a look at what CS5.5 brings you and how it makes your life easier.

Deploy to web, desktop and mobile
Mobile porting has never been easier. Choose among iOS, Android and BlackBerry Tablet OS or all of them.

Export as Bitmap for better performance
Next to Cache as Bitmap is an option to convert your vector artwork directly to bitmap format right in Flash CS5.5 IDE during export. The good thing is, that you still work with the artwork as with vector, but once you export the SWF, it’s converted to bitmap. Tweening bitmaps is less CPU demanding than vectors and your app will perform better. Unlike Cache as Bitmap, you can rotate and scale the artwork during runtime without having it re-cached - so that’s why Export as Bitmap might work better you. Cache as Bitmap is good choice, but only if you change positions - if you start rotating and scaling - it will re-cache every change. Although this can be solved with cacheAsBitmapMatrix on mobile platforms, Export as Bitmap is another very useful option to consider.

Sharing assets across FLA files
Once you create a new Flash project, you can share Library assets between different FLA files. This makes life easier, especially when you are porting your game to different screen-sizes and devices. While you link libraries together, you can change a symbol in one of the libraries and it will automatically update it in other FLA files.

In the image below I have edited the star in only one of the libraries and it’s been automatically updated in the second one.

Scale content with stage
While porting your game to different screen-sizes, this feature might come very handy. When changing the stage width and height, you can tick “Scale content with stage”, which will resize the content to fit the different stage size.

Copy/paste assets from Illustrator to Flash
I like this one, it makes my workflow faster. Although it’s a feature from CS5, it’s still good to be reminded of it. As you can see, shapes and gradients done in Illustrator are represented natively in Flash.

On-device USB debugging
Helps you to test and debug your app right on the real device. Access multitouch, accelerometer and other device specific features you are implementing in your app.

Device profiles
There are many device profiles ready for you. If there is a new device on the market, just add it by yourself or update the list.

There are many more features you’ll find useful and I hope you will enjoy building games with CS5.5.

Have a look at Lee Brimelow’s video tutorial showing new Flash CS5.5 features.

Check these links for further information about the tooling:
Flash Professional CS 5.5
Flash Builder 4.5

Visit Adobe Game Technology Center for tutorials.

Finally, look at this mobile and tablet game running on iPad, XOOM, iPhone, HTC and more built with Creative Suite 5.5 and AIR 2.6:

Stream live to iPad and HTML5 with Flash Media Server

April 12th, 2011

Adobe has just previewed at NAB in Las Vegas a streaming technology that allows HTTP Live Streaming (HLS) via MPEG2 in addition to Flash streaming.

Reach next to Flash enabled devices also iPad and other HTML5 browsers (with HLS support, such as Safari) with Flash Media Server.

Have a look at this sneak peek video, where Kevin Towes shows these features

More details are available here

FITC Amsterdam Interview About Gaming

April 11th, 2011

Mr. Chris Allen and me featured in this video interview from FITC Amsterdam 2011.

How To Rotate A Cube In 3D With Matrix

April 4th, 2011

Another simple trick to avoid locks when rotating objects in 3D.

Goal: rotate a cube in all axes and avoid axes to switch.

See the problem in a video:

1. Consider following scenario (WRONG):

Demo | Full source code

protected function init():void{
	box = new Box(200,200,200,2,2,2);
	box.setMaterialToAllFaces(new FillMaterial(0xFF0000,1,1));;
}
 
protected function onMouseMove(event:MouseEvent):void{
	if(!isDragging)
		return;
 
	var deltaX:int = lastX - event.stageX;
	var deltaY:int = lastY - event.stageY;
 
	lastX = event.stageX;
	lastY = event.stageY;
 
// IMPORTANT PART
	box.rotationZ += deltaX*Math.PI/180;
	box.rotationY += deltaY*Math.PI/180;
 
	camera.render();
}

When you use rotationZ and rotationY together you will find that by rotating the cube you switch axes and at the end you rotate different axes than you wanted at the beginning.

2. Solution: rotate with Matrix

Demo | Full source code

protected function init():void{
	box = new Box(200,200,200,2,2,2);
	box.setMaterialToAllFaces(new FillMaterial(0xFF0000,1,1));;
}
 
protected function onMouseMove(event:MouseEvent):void{
	if(!isDragging)
		return;
 
	var deltaX:int = lastX - event.stageX;
	var deltaY:int = lastY - event.stageY;
 
	lastX = event.stageX;
	lastY = event.stageY;
 
// IMPORTANT PART
	var matrix:Matrix3D = box.matrix;
 
	matrix.appendRotation(deltaX,new Vector3D(0,0,1));
	matrix.appendRotation(-deltaY,new Vector3D(1,0,0));
 
	box.matrix = matrix;
 
	camera.render();
}

See correct version - rotating a cube with:

Also if you have a different solution - don’t hesitate to share it. I am pretty sure, there are more ways to do this.