IsoHill is an isometric engine for Flash Player 11 [molehill] built on top of the Starling 2D framework. Some features:
- Plugins – engine-wide modifications
- Includes a TILED map parser
- Components – logic on the IsoSprites
- Virtually unlimited layers
- Anti-aliasing and Mipmapping
- Built for robust browser games
Sample
package { import fr.kouma.starling.utils.Stats; import isohill.GridDisplay; import isohill.IsoHill; import isohill.plugins.IsoCamera; import isohill.plugins.XRayLayers; import isohill.Point3; import isohill.tmx.TMX; import isohill.tmx.TMXLayer; import isohill.tmx.TMXPlugin; import isohill.utils.Point3Input; import starling.display.Sprite; import starling.events.Event; /** * This is a testing implementation of the IsoHill engine. * + Loads a TMX file * + Creates layers in the engine based on the data * + Adds in engine plugins * + starts the engine * * "A or Z" to zoom */ public class NatureDemo extends Sprite { public var isoHill:IsoHill; private var tmx:TMX; public function NatureDemo() { addEventListener(Event.ADDED_TO_STAGE, onStageAdded); // let's wait for Flash to get setup } private function onStageAdded(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, onStageAdded); TMX.loadTMX("./Nature/", "nature.tmx", onTMXLoad); // Load the TMX map for use in the engine } private function onTMXLoad(tmx:TMX):void { this.tmx = tmx; setup(); } // Once the TMX data has been loaded, let's setup the engine now private function setup():void { isoHill = new IsoHill(); // instance that engine addChild(isoHill); // add the engine to starling addPlugins(isoHill); isoHill.start(); // start all the runtime logic addChild(new Stats()); // Mrdoob's performance monitor } private function addPlugins(isoHill:IsoHill):void { var tmxPlugin:TMXPlugin = new TMXPlugin(tmx); // plugin to bind the TMX data to the engine // link the TMX layers to engine layers (allows for optional "in-between" layers) for (var i:int = 0; i < tmx.layersArray.length; i++) { var layer:TMXLayer = tmx.layersArray[i]; var layerName:String = layer.name; var grid:GridDisplay = tmxPlugin.makeEmptyGridOfSize(i, layerName); if (layerName.indexOf("earth")!=-1) grid.flatten(); // disable sorting and flatten the ground as it is not dynamic (speed improvement) isoHill.addLayer(i, grid); // add the layer to the engine } //isoHill.addPlugin(new XRayLayers()); isoHill.addPlugin(tmxPlugin); // adding the plugin isoHill.addPlugin(new IsoCamera(new Point3Input(stage, 0, 450))); } } }