about
history
syntax
visu
arcade
goodies
wrappers
efficiency
examples
experiments
tabageos
tutorials
actiontad logo white
Simple isometric example using the com.actiontad.isometric.SimpleISOEngine

This example uses the SimpleISOEngine to make an isometric map
and a isometric box that can be moved around the map.

SimpleISOTest.as

package
{
	import com.actiontad.gameUtils.TweenMath;
	import com.actiontad.isometric.ISOPoint;
	import com.actiontad.isometric.SimpleISOBox;
	import com.actiontad.isometric.SimpleISOEngine;
	
	
	/**
	 * Very basic use of the SimpleISOEngine
	 */
	[SWF(frameRate = '30', backgroundColor = '0x000000', width = '650', height = '400')]
	public class SimpleISOTest extends SimpleISOEngine  
	{
		
		private var box:SimpleISOBox;
		
		
		private var heightMap:Array = [
		
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,4,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[4,4,4,4,0,4,4,4,4,4],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[4,4,4,4,4,4,4,4,4,4]
		
		];
		private var skinMap:Array = [
		
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0],
			[0,0,0,0,0,0,0,0,0,0]
		
		];
		public function SimpleISOTest() {
			
			super();
			this.spacing = 45;//default is 45
			
			//Keep in mind all the properties associated with the SimpleISOEngine are Extremely delicate,
			//chaning the width, height or length of the box changes things greatly, changing the spacing effects things the most.
			//It will take some tweaking and trial and error to get the values the way you want them to be, and have everything working right.
			
			//For example, notice the commented out box that is half the width ,height and length of the original,
			//in order to get it to 'look right' with that box, simpleXOffset and simplYOffset would be adjusted by 30.
			
			box = new SimpleISOBox(null, null, 0, 0, 0, 40, 40, 40, 1, 0x000000, 0xc8FFc8, 1, new ISOPoint(0, 4, 0, 45), 45);
			//box = new SimpleISOBox(null, null, 0, 0, 0, 20, 20, 20, 1, 0x000000, 0xc8FFc8, 1, new ISOPoint(0, 4, 0, 45), 45);
			
			this.scrollTweenType = TweenMath.OUT_LINEAR;//default is just LINEAR
			this.scrollTweenInterval = 999/2;//default is 999
			this.simpleXOffset = 0;// 30;//when movementType is simple,
			this.simpleYOffset = 0;// -30;//you can use these for fine tuning the position of the userControlledObject (in this case the box)
			this.movementType = "simple";//default is simple, see ISOTest.as for a complex example.
			this.reactionHeight = 4;//things in the scene as high or higher than this will cause the box to not pass through them. default is 3.
			this.makeMap(heightMap, skinMap, 50, 5, 50, 0x000000, 0x6495ED, 45);//the main function that draws the map using the arrays.
			this.autoScroll = true;//default is false
			this.allowSpaceBarSceneControl = false;//default is true
			this.container.addChild(box);//box is assigned as the userControlledObject at this time, key control is also set up.
			this.moveSceneBy(-40, -120);
		}
	}
	
}


The Result - SimpleISOEngine Isometric scene - click on it first for keyboard control


See the example in its own window here.










actiontad twitter.com/actiontad terms