about
history
syntax
visu
arcade
goodies
wrappers
efficiency
examples
experiments
tabageos
tutorials
actiontad logo white
A Quick Quest with the PreDrawnLandEngine

This example uses the PreDrawnLandEngine to set up a basic RPG scene. The player moves a dog around in search of a bone.
Most of the functionality is handled by the PreDrawnLandEngine and the RPGWalker classes.
The TileSetPainter app (available on this page tabageos main page) was used to quickly draw out the scene and get the needed arrays.

An edited RefMap ( tekepon.net/fsm ) sprite sheet was used for the images.

QuickQuest.as

package
{
	
	import com.actiontad.basicGameEvents.GameObjectEvents;
	import com.actiontad.basicGameEvents.HitEvent;
	import com.actiontad.basicGameObjects.AttachableBGO;
	import com.actiontad.basicGameObjects.PreDrawnLandEngine;
	import com.actiontad.basicGameObjects.RPGWalker;
	
	import com.actiontad.gameUtils.TweenMath;
	import com.actiontad.gameUtils.BlitMath;
	import com.actiontad.gameUtils.BlitSpecs;
	import com.actiontad.gameUtils.TilesetSpecs;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.events.Event;
	import flash.geom.Point;
	
	/**
	 * QuickQuest - Find the bone in the snow 
* An example quick use of the PreDrawnLandEngine and related classes.

* * The TileSetPainter AIR app was used to quickly draw out the scenery and ground Arrays via images.
* Edited RefMap ( tekepon.net/fsm/images ) images were used for this game.
* */ [SWF(frameRate = '30', backgroundColor = '0x000000', width = '640', height = '400')] public class QuickQuest extends PreDrawnLandEngine { private var hero:RPGWalker; private var sheet:BitmapData; private var bone:AttachableBGO; private var time:Number = 999; private var foundText:TextField; private var tweens:Array = []; //the TileSetPainter app was used to quickly draw out and receive these arrays using drawn images. private var scenery:Array = [ [ [25,15], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [29,25], [25,15], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,17], [28,19] ], [ [25,15], [33,24], [33,25], [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], [33,24], [33,25], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [26,15], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,17], [0,0] ], [ [25,15], [34,24], [34,25], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [33,24], [33,25], [0,0], [0,0], [0,0], [0,0], [0,0], [34,24], [34,25], [0,0], [0,0], [29,21], [29,22], [0,0], [0,0], [27,15], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,17], [0,0] ], [ [25,15], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [34,24], [34,25], [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], [28,15], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,16], [28,17], [0,0] ], [ [25,15], [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] ], [ [25,15], [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] ], [ [25,15], [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], [33,19], [33,20], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0] ], [ [25,15], [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], [26,26], [26,27], [26,28], [26,29], [26,30], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [34,19], [34,20], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0] ], [ [25,15], [23,12], [23,13], [23,13], [23,13], [23,13], [23,13], [23,13], [23,13], [23,13], [23,13], [23,13], [23,14], [0,0], [17,13], [17,13], [17,13], [0,0], [0,0], [0,0], [27,26], [27,27], [27,28], [27,29], [26,30], [26,30], [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] ], [ [25,15], [24,12], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [24,14], [0,0], [23,12], [23,13], [23,14], [0,0], [0,0], [0,0], [28,26], [28,27], [28,28], [28,29], [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] ], [ [25,15], [25,12], [25,13], [25,13], [25,13], [25,13], [25,13], [25,13], [25,13], [25,13], [25,13], [25,13], [25,14], [0,0], [24,12], [24,13], [24,14], [0,0], [0,0], [0,0], [29,26], [29,27], [29,28], [29,29], [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] ], [ [25,15], [17,1], [17,1], [17,1], [17,1], [17,1], [17,1], [17,1], [17,1], [17,1], [17,13], [17,1], [17,1], [0,0], [25,12], [25,13], [25,14], [0,0], [0,0], [0,0], [30,26], [30,27], [30,28], [30,29], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [33,18], [0,0], [0,0], [0,0], [0,0], [0,0] ], [ [25,15], [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], [34,18], [0,0], [0,0], [0,0], [0,0], [0,0] ], [ [25,15], [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] ], [ [25,15], [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] ], [ [25,15], [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] ], [ [25,15], [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] ], [ [25,15], [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] ], [ [25,15], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [22,29], [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], [19,12], [19,13], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0] ], [ [25,15], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [23,29], [23,30], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [33,19], [33,20], [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] ], [ [25,15], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [24,29], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [34,19], [34,20], [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] ], [ [25,15], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [17,13], [17,13], [17,13], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [24,27], [24,28], [0,0], [0,0], [0,0], [0,0], [17,13], [17,13], [17,13], [17,13], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0], [0,0] ], [ [25,15], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13], [17,13] ], [ [26,15], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16], [26,16] ], [ [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16], [27,16] ] ]; private var groundAndWalkWay:Array = [ [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [20,9], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [22,9], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [24,13], [25,16], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [24,13], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [24,13], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [33,7], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [33,7], [20,9], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [20,10], [21,10], [21,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [33,7], [22,9], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,10], [22,11], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ], [ [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16], [25,16] ] ]; public function QuickQuest() { var specs:TilesetSpecs = new TilesetSpecs(); specs.tileHeight = 16; specs.tileWidth = 16; specs.screenWidth = 640; specs.screenHeight = 400; this.sheet = new BasicLandAndAnimals().bitmapData; super(this.sheet, [], [], [0], specs, null, null); } override public function subscribe(e:Event = null):void { super.subscribe(e); hero = new RPGWalker(this.sheet, new BlitSpecs(32, 48, 1, 1, 1, new Point(), new Point(), true, true), null, [13, [3, 4, 5]], [14,[3,4,5]], [15,[3,4,5]], [12,[3,4,5]], [12,[3,4,5]]); this.establishPatterns(scenery);//these two methods do many things this.drawWholeLevel(1, []);//a grid is set up and bitmaps are drawn and added into the land property, acording to the number of patterns passed. this.stopContainerMovement();//the default behavior of the engine is to move the container, mario brothers style, along with the mainChar property that automatically gets set. //in this case the container does not need to move so we stop it with the above call. var floor:Bitmap; var floorBMD:BitmapData = new BitmapData(640, 400, true, 0x000000); BlitMath.specificPatternBlit(floorBMD, this.sheet, groundAndWalkWay); floor = new Bitmap(floorBMD); addChildAt(floor, 0); hero.x = hero.y = 200; this.container.addChild(hero);//remember that only things inside the container cause hit events in the SimplePlatformEngine super class. bone = new AttachableBGO(); bone.graphics.beginFill(0xFFFDFF); bone.graphics.lineStyle(1, 0xDDDDDD); bone.graphics.drawRect(0, 0, 16, 4); bone.addEventListener(HitEvent.HIT, collectBone); container.addChild(bone); foundText = new TextField(); foundText.selectable = false; foundText.autoSize = "left"; foundText.defaultTextFormat = new TextFormat("sans", 35, 0x000000, true); placeRandomBone(); } private function placeRandomBone():void { var xRan:int = int(Math.random() * 640); var rx:Number = xRan + (xRan >= 570 ? 0 : 25); var yRan:int = int(Math.random() * 400); var ry:Number = yRan + (yRan >= 340 ? 0 : 25); if( this.wayIsClear(rx,ry) ) { //make sure the bone is not placed on a spot the dog can not access. bone.x = rx; //wayIsClear is a very useful method of the PreDrawnLandEngine and an implementation of IWayDeterminer bone.y = ry; } else { while ( !this.wayIsClear(rx, ry) ) { xRan= int(Math.random() * 640); rx = xRan + (xRan >= 570 ? 0 : 25); yRan = int(Math.random() * 400); ry = yRan + (yRan >= 340 ? 0 : 25); } bone.x = rx; bone.y = ry; } } private function collectBone(e:HitEvent):void { var hitter:RPGWalker = this.simpleResolve(e.hitSpecs.theHitter) as RPGWalker; if (hitter) { placeRandomBone(); showBoneFound(); } } private function showBoneFound():void { time = 1998;//the looperDelay is 33.3, so one second is 33.3*30 or 999 foundText.text = "Bone Found!"; if(!contains(foundText)) addChild(foundText); foundText.x = 320 - (foundText.width / 2); foundText.y = 200 - (foundText.height / 2); tweens = TweenMath.tweenArray(foundText.y - 35, foundText.y, 1998, TweenMath.OUT_ELASTIC); this.removeEventListener(GameObjectEvents.LOOP, showTextField); this.addEventListener(GameObjectEvents.LOOP, showTextField); } private function showTextField(e:Event):void { time -= this.looperDelay;//33.3 if (tweens.length > 0) foundText.y = tweens.shift(); if (time <= 0) { this.removeChild(foundText); this.removeEventListener(GameObjectEvents.LOOP, showTextField); } } } }


package
{
	import flash.display.Bitmap;
	
	/**
	 *  The sprite sheet used in this example
	 */
	[Embed(source="masterSheetTut124bw.png")]
	public class BasicLandAndAnimals extends Bitmap  
	{
		public function BasicLandAndAnimals() {
			
		}
	}
	
}


The Result - Basic RPG Scene, move the dog with the arrows and try to find the bone
click on it first for keyboard control



See the example in its own window here.










actiontad twitter.com/actiontad terms