as3isolib Actionscript 3 Isometric Library for Flash/Flex

as3isolib is a great isometric library for actionscript 3 by Justin Opitz.  This is a lower level isometric library that could be used in building your own isometric gaming engine or learning more about the popular isometric view in games or other flash content.

From building basic blocks…

To constructing sprites and objects with individual iso objects with their own bounding boxes.


This sample shows a two piece tree, a common issue with sprites in isometric is where to slice them up.  This sample shows a tree with the leaves able to be in front of a character so that you could walk under the tree and be in front of the trunk but covered by the trees.  Essentially height is respected.

Sample code for the tree tutorial:

package
{
        import as3isolib.display.IsoSprite;
        import as3isolib.display.primitive.IsoBox;
        import as3isolib.display.scene.IsoGrid;
        import as3isolib.display.scene.IsoScene;

        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.net.URLRequest;

        public class IsoApplication extends Sprite
        {
                private var scene:IsoScene;
                private var assets:Object;

                private var loader:Loader

                private function loadAssets ():void
                {
                        loader = new Loader();
                        loader.contentLoaderInfo.addEventListener(Event.INIT, loader_initHandler);
                        loader.load(new URLRequest("assets/swf/assets.swf"));

                }

                private function loader_initHandler (evt:Event):void
                {
                        buildScene();
                }

                private function buildScene ():void
                {
                        scene = new IsoScene();
                        scene.hostContainer = this;
                        scene.container.x = 200;
                        scene.container.y = 200;

                        var treeTrunkClass:Class = loader.contentLoaderInfo.applicationDomain.getDefinition("TreeTrunk") as Class;
                        var treeLeavesClass:Class = loader.contentLoaderInfo.applicationDomain.getDefinition("TreeLeaves") as Class;

                        var grid:IsoGrid = new IsoGrid();
                        grid.showOrigin = false;
                        scene.addChild(grid);

                        var s0:IsoSprite = new IsoSprite();
                        s0.setSize(25, 25, 65);
                        s0.moveTo(50, 50, 0);
                        s0.sprites = [treeTrunkClass];
                        scene.addChild(s0);

                        var s1:IsoSprite = new IsoSprite();
                        s1.setSize(125, 125, 100);
                        s1.moveTo(0, 0, 75);
                        s1.sprites = [treeLeavesClass];
                        scene.addChild(s1);

                        scene.render();
                }

                public function IsoApplication ()
                {
                        loadAssets();
                }
        }
}

current features

  • simple scene creation
  • 3 primitive types
  • base class for displaying user-created content
  • plenty of styling option on vector based primitives
  • integrates well with a variety of tween engines
  • standard 3D isometric positional sorting

So get busy building the flash version of roller coaster tycoon…

haXe 2.01 Now with Flash 10 Support

Photobucket

Nicolas Cannasse has released haXe 2.01 that now has flash 10 support with a simple switch including the new Vector class.

Another very good news is that haXe has now complete support for Flash 10.
You only have to use -swf-version 10 as commandline parameter to be able to access the new Flash10 APIs (don’t forget to install first the FP10 from labs.adobe.com).

I think it is very possible for haXe to catch on big time, but it takes time as stated. Just remember that Python was worked on almost solely by Guido van Rossum for about 5-years, and then 10-years later it was picked up by Google heavily and the rest is history.  I think it takes 10 years for anything to really catch on from standards to languages.

code_swarm – Python from Michael Ogawa on Vimeo.

Blender to .as3 Exporter for Papervision 3D, Away3D and Sandy3D Updated

If you are exporting from blender to actionscript directly so you can get your models into flash as script you can use the Blender to .as3 exporter which so kindly supports all flash 3d engines currently Away3D, Papervision3D and Sandy3D.  Dennis Ippel made the Blender exporter a while back but the update supports papervision 2.0.

The benefits of COLLADA are nice but there are so many differences that you can run into trouble.  With the exporter it is a direct faces and vector export without all the bloat of DAE/COLLADA xml.  This works if you are only developing for flash and dont’ need to use the models in other platforms/systems/engines that aren’t in flash.

AS3 Zupko’s Reflections and Shadows with Raycasting in Papervision 3D

The Zupko show continues with reflections in Papervision 3D [demo].

Be sure to check out the shadow demo that this is based on:

After posting my shadow experiment, Patrick Matte posed a question wondering if I would be able to do real-time reflections in a similar manner. The next day I had it done, along with some nice iterations along the way: orthographic and perspective projection (I can release those later if anyone really wants them). I’ve been sitting on it every since and finally decided I would take the time to write a little description into how its done and give the code to those who are interested (and I fixed up some code for backface culling in the reflection this morning).

AS3 Plinko with APE 2D Flash Physics Engine

I rarely mention stuff I have worked on here but I got a chance to use APE and AS3 on the online Plinko game at the site for the Price is Right videogame for the famed pink Plinko Board.  Who doesn’t love Plinko?

I did the programming on this back when I still worked at emarketing/prizelogic.

I will be featuring a small iteration to APE with draggable particles and how I did it.  In the end I didn’t use the draggable particles but they are fun (i ended up changing my collision/border particles after testing).  I ended up controlling the drop location by swapping out a wheel particle after they dropped it.  So that it got the famous Plinko disc bounce and roll.

Why did I use APE? Well it is the least complex physics engine.  I started off with Box2dFlashAS3 and will post that one maybe as well but ended up going with APE mainly for integration it was easier that it was a less intensive codebase.  Box2DFlashAS3 can scare non C++ coders with it’s style let alone AS2 coders moving to AS3.

It is slower with all the other animation going on in the site but you can also play on my server here just the Plinko part.

Can you get 10,000?

AS3 Library and LibraryManager for Assets and Other AS3 Utilities

Tink posted a great library manager for using external assets in your flash projects. When you start getting deep in projects you end up either having to roll your own that might end up being project specific, or you can just grab this from Tink and it is nice and standardized now for you.

Here’s and example of our Library & LibraryManager classes that we use in some of our Flex and AS 3.0 projects to manage our external assets stored in SWF’s.

The classes enabled you to create multiple libraries of embedded (retaining and giving access to code) or loaded SWF’s.

You can create instance of Library wherever you want, but you can also create them through the LibraryManager giving you a single class to gain access to all your Library instances.

As you develop more and more flash/flex projects with AS3 these types of utilities come in handy. Another that comes to mind is Arthur Debert’s BulkLoader and polygonal labs Data Structures for Game Developers that are all great kits.

Add Tink’s Library and LibraryManager to your arsenal today! Thanks Tink.

Adobe Opens Flash Format Specifications for SWF, AMF and Flash Video FLV (Open Screen Project)

Adobe is taking the inside lane in the industry it seems with the Open Screen Project. What does this mean? It seems like SWF and FLV formats are now largely open and licenses removed. With the XFL format possibly on its way (probably based on mxml) to replace closed .FLA files it is pretty clear that Adobe and Flash will see a large uptick in the mindshare. As well as looking to create a broader mobile platform for the flash player.

The Open Screen Project will address potential technology fragmentation by enabling the runtime technology to be updated seamlessly over the air on mobile devices. The consistent runtime environment is intended to provide optimal performance across a variety of operating systems and devices, and ultimately provide the best experience to consumers.

To support this mission, and as part of Adobe’s ongoing commitment to enable Web innovation, Adobe will continue to open access to Adobe Flash technology, accelerating the deployment of content and rich Internet applications (RIAs). This work will include:

  • Removing restrictions on use of the SWF and FLV/F4V specifications
  • Publishing the device porting layer APIs for Adobe Flash Player
  • Publishing the Adobe Flash® Cast™ protocol and the AMF protocol for robust data services
  • Removing licensing fees – making next major releases of Adobe Flash Player and Adobe AIR for devices free

This is big. It has mutiple prongs. Adobe would like to make Flash a common mobile standard, hrm no Apple on this list (it is probably a slight move there against that).

Adobe would also like to continue their lead of web video. And they finally are recognizing the closed format of SWF is not as desirable as an open one, there is still considerable control for Adobe over the player. But they get insights and contributions from many large companies to help make it work on their platform, engraining the format further. The providers, especially mobile and internet tv, will want to provide good user experiences to compete with the iPhone and regular T.V. respectively. Flash being open helps both of those markets.

Adobe is also moving further to open source key formats and technologies like the recent Flex 3 SDK and now the AMF format which was a roadblock. This is probably good news for servers like Red5 and also many other media servers and remoting services in many more place. AMF is particularly nice because it is a binary, extremely compact and limited bloat format. Without it being open it loses much of its benefit as a standard. Being open and a further crunching from the XML bloat services, this can be very good for many reasons such as throughput and faster services, apps and games with remote data.

Another reason is the desktop market. They want Flash to work flawlessly on Linux but they don’t’ have the manpower for a 2% market share. So this is a very smart move for the desktop players (AIR, and Linux Flash).

The only thing that partially makes it scary is the line up, Sony, Verizon, etc. As long as these are contributors and not partners in DRM crime then we have something. Hopefully they are in it to make better entertainment and mobile platforms cheaper.

Being able to peer into the code and a move to allow better open integration makes it a better platform, where better stuff can be built on top of that. Let’s hope it is done right. Everyone is making Apple look really closed and locked down lately.