Saturday, 23 December 2023

Major setback for Prosperity valley.

Apology 
Stencyl-nator apologises for additional delays up to 1 year for the very confusing logic in our game code that is the rendering system (code mode) for objects that spans multiple tiles.  In this case, Stencyl-nator will start over the entire rendering system with simpler flow but similar concept. But before you can easily understand how this logic works in details, here is the concept for 1-tile object rendering system http://stencyl-nator.blogspot.com/p/endless-scenes.html

Asides from confusion, Stencyl-nator has been employed to be door-to-door salesman. Currently in probation and probably be back/fired within 2 weeks because not making enough sales and the economy is very bad.  So the progress will be far slower than it used to be. Aside form the work itself, the flyers have to be written at home so there will propably not be any progress during weekdays not even for asteroidgen or intermod (Mindustry mods in progress).  

Stencyl-nator has also been a black belt procrastinator especially after dealing with his resume. Will be working to deal with bingewatching habit. 
 
Concept - old version vs new version 
The new version renders either from positive or negative direction. instead of only for positive directions only. 
old version - early 2023
old version - june 2023

late version - dec 2023
New version - dec 2023 

The new version should be around 30% shorter than the old version. 

The incomplete old code
this is where the post is lengthened. Full code only. Let's see if you can find any mistakes asides the incomplete ones. this is already over 1000 lines incomplete, it should be around 2000 lines when completed. 

package scripts;
import com.stencyl.Engine; 
import com.stencyl.behavior.Script; // create actors. 
import com.stencyl.models.Actor; // last_created_actor
import com.stencyl.models.actor.ActorType; 
import com.stencyl.models.actor.Group; 
import com.stencyl.utils.motion.EasingFunction; //for custom tweening functions
import scripts.F; // for diagnosis pruposes. 

class Objdata //this to be a variable in a scenne behaviours. The resaon why this has been separated from the scene behavs is because the code itself is too long and is most of the code. 
{
public var actors_rnx: Array<Dynamic>=[]; public var actors_rny: Array<Dynamic>=[]; 
public var actors_rpx: Array<Dynamic>=[]; public var actors_rpy: Array<Dynamic>=[]; //actors for killings when leaving the screen. 
public var ocu_nxny:Array<Dynamic>=[]; public var ocu_nxpy:Array<Dynamic> =[]; 
public var ocu_pxny:Array<Dynamic> =[]; public var ocu_pxpy:Array<Dynamic> =[]; 
public var atr_rnx_nxny: Array<Dynamic>; public var atr_rnx_nxpy: Array<Dynamic>; 
public var atr_rnx_pxny: Array<Dynamic>; public var atr_rnx_pxpy: Array<Dynamic>; // attributes and other data. 
public var atr_rny_nxny: Array<Dynamic>; public var atr_rny_nxpy: Array<Dynamic>; 
public var atr_rny_pxny: Array<Dynamic>; public var atr_rny_pxpy: Array<Dynamic>;
public var atr_rpx_nxny: Array<Dynamic>; public var atr_rpx_nxpy: Array<Dynamic>; 
public var atr_rpx_pxny: Array<Dynamic>; public var atr_rpx_pxpy: Array<Dynamic>;
public var atr_rpy_nxny: Array<Dynamic>; public var atr_rpy_nxpy: Array<Dynamic>; 
public var atr_rpy_pxny: Array<Dynamic>; public var atr_rpy_pxpy: Array<Dynamic>;

public var ids_rnx_nxny: Array<Dynamic>; public var ids_rnx_nxpy: Array<Dynamic>; 
public var ids_rnx_pxny: Array<Dynamic>; public var ids_rnx_pxpy: Array<Dynamic>; // ids -- determines the actor types. 
public var ids_rny_nxny: Array<Dynamic>; public var ids_rny_nxpy: Array<Dynamic>; 
public var ids_rny_pxny: Array<Dynamic>; public var ids_rny_pxpy: Array<Dynamic>;
public var ids_rpx_nxny: Array<Dynamic>; public var ids_rpx_nxpy: Array<Dynamic>; 
public var ids_rpx_pxny: Array<Dynamic>; public var ids_rpx_pxpy: Array<Dynamic>;
public var ids_rpy_nxny: Array<Dynamic>; public var ids_rpy_nxpy: Array<Dynamic>; 
public var ids_rpy_pxny: Array<Dynamic>; public var ids_rpy_pxpy: Array<Dynamic>;

public var rfl_rnx_nxny: Array<Dynamic>; public var rfl_rnx_nxpy: Array<Dynamic>; 
public var rfl_rnx_pxny: Array<Dynamic>; public var rfl_rnx_pxpy: Array<Dynamic>; // reflactions
public var rfl_rny_nxny: Array<Dynamic>; public var rfl_rny_nxpy: Array<Dynamic>; 
public var rfl_rny_pxny: Array<Dynamic>; public var rfl_rny_pxpy: Array<Dynamic>; 
public var rfl_rpx_nxny: Array<Dynamic>; public var rfl_rpx_nxpy: Array<Dynamic>; 
public var rfl_rpx_pxny: Array<Dynamic>; public var rfl_rpx_pxpy: Array<Dynamic>; 
public var rfl_rpy_nxny: Array<Dynamic>; public var rfl_rpy_nxpy: Array<Dynamic>; 
public var rfl_rpy_pxny: Array<Dynamic>; public var rfl_rpy_pxpy: Array<Dynamic>; 

public var rot_rnx_nxny: Array<Dynamic>; public var rot_rnx_nxpy: Array<Dynamic>; 
public var rot_rnx_pxny: Array<Dynamic>; public var rot_rnx_pxpy: Array<Dynamic>; // rotation
public var rot_rny_nxny: Array<Dynamic>; public var rot_rny_nxpy: Array<Dynamic>; 
public var rot_rny_pxny: Array<Dynamic>; public var rot_rny_pxpy: Array<Dynamic>;
public var rot_rpx_nxny: Array<Dynamic>; public var rot_rpx_nxpy: Array<Dynamic>; 
public var rot_rpx_pxny: Array<Dynamic>; public var rot_rpx_pxpy: Array<Dynamic>;
public var rot_rpy_nxny: Array<Dynamic>; public var rot_rpy_nxpy: Array<Dynamic>; 
public var rot_rpy_pxny: Array<Dynamic>; public var rot_rpy_pxpy: Array<Dynamic>;

// all the scene data. 
public var scene = Engine.engine.scene; public var scene_type:String = ""; 
public var offsx:Float=0; public var offsy:Float=0; 
public var sceh:Int = Engine.engine.scene.sceneHeight;  
public var scew:Int = Engine.engine.scene.sceneWidth;  // scene dimensions
public var scrh:Int = Engine.screenHeight;  public var scrw:Int = Engine.screenWidth;  
public var initile_xmax:Int; public var initile_xmin:Int; 
public var initile_ymax:Int; public var initile_ymin:Int; 
public var half_sceh:Int = Std.int(Engine.engine.scene.sceneHeight/2); 
public var half_scew:Int = Std.int(Engine.engine.scene.sceneWidth/2); 
public var undefined_kill_list:Int; 
public var last_created_actor:Actor; 
// for diagnosis purpose only
public var f:F = new F(); public var number_of_objects:Int =0; 
public var diag_create_x:Int; public var diag_create_y:Int; 

public function new()
{
this.f.f_cu = Script.getFont(19);
this.atr_rnx_nxny = []; this.atr_rnx_nxpy = []; this.atr_rnx_pxny = []; this.atr_rnx_pxpy = [];
this.atr_rpx_nxny = []; this.atr_rpx_nxpy = []; this.atr_rpx_pxny = []; this.atr_rpx_pxpy = [];
this.atr_rny_nxny = []; this.atr_rny_nxpy = []; this.atr_rny_pxny = []; this.atr_rny_pxpy = [];
this.atr_rpy_nxny = []; this.atr_rpy_nxpy = []; this.atr_rpy_pxny = []; this.atr_rpy_pxpy = [];

this.ids_rnx_nxny = []; this.ids_rnx_nxpy = []; this.ids_rnx_pxny = []; this.ids_rnx_pxpy = [];
this.ids_rny_nxny = []; this.ids_rny_nxpy = []; this.ids_rny_pxny = []; this.ids_rny_pxpy = [];
this.ids_rpx_nxny = []; this.ids_rpx_nxpy = []; this.ids_rpx_pxny = []; this.ids_rpx_pxpy = [];
this.ids_rpy_nxny = []; this.ids_rpy_nxpy = []; this.ids_rpy_pxny = []; this.ids_rpy_pxpy = [];

this.rfl_rnx_nxny = []; this.rfl_rnx_nxpy = []; this.rfl_rnx_pxny = []; this.rfl_rnx_pxpy = [];
this.rfl_rny_nxny = []; this.rfl_rny_nxpy = []; this.rfl_rny_pxny = []; this.rfl_rny_pxpy = [];
this.rfl_rpx_nxny = []; this.rfl_rpx_nxpy = []; this.rfl_rpx_pxny = []; this.rfl_rpx_pxpy = [];
this.rfl_rpy_nxny = []; this.rfl_rpy_nxpy = []; this.rfl_rpy_pxny = []; this.rfl_rpy_pxpy = [];

this.rfl_rnx_nxny = []; this.rfl_rnx_nxpy = []; this.rfl_rnx_pxny = []; this.rfl_rnx_pxpy = [];
this.rfl_rny_nxny = []; this.rfl_rny_nxpy = []; this.rfl_rny_pxny = []; this.rfl_rny_pxpy = [];
this.rfl_rpx_nxny = []; this.rfl_rpx_nxpy = []; this.rfl_rpx_pxny = []; this.rfl_rpx_pxpy = [];
this.rfl_rpy_nxny = []; this.rfl_rpy_nxpy = []; this.rfl_rpy_pxny = []; this.rfl_rpy_pxpy = [];
}
public function abs(a:Float):Float{if(a > 0) return a; else if(a < 0) return 0-a; else return 0;}
public function create_actor(a:String,x:Float,y:Float,layer:Int):Void 
{var b:Actor=Engine.engine.getRecycledActorOfTypeOnLayer(Conte.obdat_actorType(a), x, y,layer); this.last_created_actor = b;}
public function diagnosis_data(x:Float, y:Float):Void // use when drawing listeners or its derivatives or When Drawing (snippet design mode)
{
this.f.ds("object data diagnosis: ", x,y);
this.f.ds("offsx: " + this.offsx,x,y+20); 
this.f.ds("offsy: " + this.offsy,x,y+40);
this.f.ds("initile_xmax: " + this.initile_xmax,x,y + 70);
this.f.ds("initile_xmin: " + this.initile_xmin,x,y + 90);
this.f.ds("initile_ymax: " + this.initile_ymax,x,y + 110);
this.f.ds("initile_ymin: " + this.initile_ymin,x,y + 130);
this.f.ds("number_of_object: " + this.number_of_objects,x,y +150);
this.f.ds("undefined_actor column: " + this.undefined_kill_list,x,y+180); // current diagnosis data is the undefined actor column is on the edge. 
}
public function get_ocu(x,y):Bool
{
if(x < 0)
{
if(y < 0)
{
if(this.ocu_nxny[0-x]==null || ""+this.ocu_nxny[0-x]=="undefined"){this.ocu_nxny[0-x]=[]; return false;}
if(this.ocu_nxny[0-x][0-y]==null || ""+this.ocu_nxny[0-x][0-y]=="undefined"){this.ocu_nxny[0-x][0-y]=false; return false;}
else if(this.ocu_nxny[0-x][0-y]== true){return true;}
}
else
{
if(this.ocu_nxpy[0-x]==null || ""+this.ocu_nxpy[0-x]=="undefined"){this.ocu_nxpy[0-x]=[]; return false;}
if(this.ocu_nxpy[0-x][y]==null || ""+this.ocu_nxpy[0-x][y]=="undefined"){this.ocu_nxpy[0-x][y]=false; return false;}
else if(this.ocu_nxpy[0-x][y]== true){return true;}
}
}
else
{
if(y < 0)
{
if(this.ocu_pxny[x]==null || ""+this.ocu_pxny[x]=="undefined"){this.ocu_pxny[x]=[]; return false;}
if(this.ocu_pxny[x][0-y]==null || ""+this.ocu_pxny[x][0-y]=="undefined"){this.ocu_pxny[x][0-y]=false; return false;}
else if(this.ocu_pxny[x][0-y]== true){return true;}
}
else
{
if(this.ocu_pxpy[x]==null || ""+this.ocu_pxpy[x]=="undefined"){this.ocu_pxpy[x]=[]; return false;}
if(this.ocu_pxpy[x][y]==null || ""+this.ocu_pxpy[x][y]=="undefined"){this.ocu_pxpy[x][y]=false; return false;}
else if(this.ocu_pxpy[x][y]== true){return true;}
}
}
return false; 
}

public function init() // initialise all the data. 
{
if(this.atr_rnx_nxny == null ||""+this.atr_rnx_nxny == "undefined"){this.atr_rnx_nxny = [];}
if(this.atr_rnx_nxpy == null ||""+this.atr_rnx_nxpy == "undefined"){this.atr_rnx_nxpy = [];}
if(this.atr_rnx_pxny == null ||""+this.atr_rnx_pxny == "undefined"){this.atr_rnx_pxny = [];}
if(this.atr_rnx_pxpy == null ||""+this.atr_rnx_pxpy == "undefined"){this.atr_rnx_pxpy = [];}
if(this.atr_rny_nxny == null ||""+this.atr_rny_nxny == "undefined"){this.atr_rny_nxny = [];}
if(this.atr_rny_nxpy == null ||""+this.atr_rny_nxpy == "undefined"){this.atr_rny_nxpy = [];}
if(this.atr_rny_pxny == null ||""+this.atr_rny_pxny == "undefined"){this.atr_rny_pxny = [];}
if(this.atr_rny_pxpy == null ||""+this.atr_rny_pxpy == "undefined"){this.atr_rny_pxpy = [];}
if(this.atr_rpx_nxny == null ||""+this.atr_rpx_nxny == "undefined"){this.atr_rpx_nxny = [];}
if(this.atr_rpx_nxpy == null ||""+this.atr_rpx_nxpy == "undefined"){this.atr_rpx_nxpy = [];}
if(this.atr_rpx_pxny == null ||""+this.atr_rpx_pxny == "undefined"){this.atr_rpx_pxny = [];}
if(this.atr_rpx_pxpy == null ||""+this.atr_rpx_pxpy == "undefined"){this.atr_rpx_pxpy = [];}
if(this.atr_rpy_nxny == null ||""+this.atr_rpy_nxny == "undefined"){this.atr_rpy_nxny = [];}
if(this.atr_rpy_nxpy == null ||""+this.atr_rpy_nxpy == "undefined"){this.atr_rpy_nxpy = [];}
if(this.atr_rpy_pxny == null ||""+this.atr_rpy_pxny == "undefined"){this.atr_rpy_pxny = [];}
if(this.atr_rpy_pxpy == null ||""+this.atr_rpy_pxpy == "undefined"){this.atr_rpy_pxpy = [];}

if(this.ids_rnx_nxny == null ||""+this.ids_rnx_nxny == "undefined"){this.ids_rnx_nxny = [];}
if(this.ids_rnx_nxpy == null ||""+this.ids_rnx_nxpy == "undefined"){this.ids_rnx_nxpy = [];}
if(this.ids_rnx_pxny == null ||""+this.ids_rnx_pxny == "undefined"){this.ids_rnx_pxny = [];}
if(this.ids_rnx_pxpy == null ||""+this.ids_rnx_pxpy == "undefined"){this.ids_rnx_pxpy = [];}
if(this.ids_rny_nxny == null ||""+this.ids_rny_nxny == "undefined"){this.ids_rny_nxny = [];}
if(this.ids_rny_nxpy == null ||""+this.ids_rny_nxpy == "undefined"){this.ids_rny_nxpy = [];}
if(this.ids_rny_pxny == null ||""+this.ids_rny_pxny == "undefined"){this.ids_rny_pxny = [];}
if(this.ids_rny_pxpy == null ||""+this.ids_rny_pxpy == "undefined"){this.ids_rny_pxpy = [];}
if(this.ids_rpx_nxny == null ||""+this.ids_rpx_nxny == "undefined"){this.ids_rpx_nxny = [];}
if(this.ids_rpx_nxpy == null ||""+this.ids_rpx_nxpy == "undefined"){this.ids_rpx_nxpy = [];}
if(this.ids_rpx_pxny == null ||""+this.ids_rpx_pxny == "undefined"){this.ids_rpx_pxny = [];}
if(this.ids_rpx_pxpy == null ||""+this.ids_rpx_pxpy == "undefined"){this.ids_rpx_pxpy = [];}
if(this.ids_rpy_nxny == null ||""+this.ids_rpy_nxny == "undefined"){this.ids_rpy_nxny = [];}
if(this.ids_rpy_nxpy == null ||""+this.ids_rpy_nxpy == "undefined"){this.ids_rpy_nxpy = [];}
if(this.ids_rpy_pxny == null ||""+this.ids_rpy_pxny == "undefined"){this.ids_rpy_pxny = [];}
if(this.ids_rpy_pxpy == null ||""+this.ids_rpy_pxpy == "undefined"){this.ids_rpy_pxpy = [];}

if(this.rfl_rnx_nxny == null ||""+this.rfl_rnx_nxny == "undefined"){this.rfl_rnx_nxny = [];}
if(this.rfl_rnx_nxpy == null ||""+this.rfl_rnx_nxpy == "undefined"){this.rfl_rnx_nxpy = [];}
if(this.rfl_rnx_pxny == null ||""+this.rfl_rnx_pxny == "undefined"){this.rfl_rnx_pxny = [];}
if(this.rfl_rnx_pxpy == null ||""+this.rfl_rnx_pxpy == "undefined"){this.rfl_rnx_pxpy = [];}
if(this.rfl_rny_nxny == null ||""+this.rfl_rny_nxny == "undefined"){this.rfl_rny_nxny = [];}
if(this.rfl_rny_nxpy == null ||""+this.rfl_rny_nxpy == "undefined"){this.rfl_rny_nxpy = [];}
if(this.rfl_rny_pxny == null ||""+this.rfl_rny_pxny == "undefined"){this.rfl_rny_pxny = [];}
if(this.rfl_rny_pxpy == null ||""+this.rfl_rny_pxpy == "undefined"){this.rfl_rny_pxpy = [];}
if(this.rfl_rpx_nxny == null ||""+this.rfl_rpx_nxny == "undefined"){this.rfl_rpx_nxny = [];}
if(this.rfl_rpx_nxpy == null ||""+this.rfl_rpx_nxpy == "undefined"){this.rfl_rpx_nxpy = [];}
if(this.rfl_rpx_pxny == null ||""+this.rfl_rpx_pxny == "undefined"){this.rfl_rpx_pxny = [];}
if(this.rfl_rpx_pxpy == null ||""+this.rfl_rpx_pxpy == "undefined"){this.rfl_rpx_pxpy = [];}
if(this.rfl_rpy_nxny == null ||""+this.rfl_rpy_nxny == "undefined"){this.rfl_rpy_nxny = [];}
if(this.rfl_rpy_nxpy == null ||""+this.rfl_rpy_nxpy == "undefined"){this.rfl_rpy_nxpy = [];}
if(this.rfl_rpy_pxny == null ||""+this.rfl_rpy_pxny == "undefined"){this.rfl_rpy_pxny = [];}
if(this.rfl_rpy_pxpy == null ||""+this.rfl_rpy_pxpy == "undefined"){this.rfl_rpy_pxpy = [];}

if(this.rot_rnx_nxny == null ||""+this.rot_rnx_nxny == "undefined"){this.rot_rnx_nxny = [];}
if(this.rot_rnx_nxpy == null ||""+this.rot_rnx_nxpy == "undefined"){this.rot_rnx_nxpy = [];}
if(this.rot_rnx_pxny == null ||""+this.rot_rnx_pxny == "undefined"){this.rot_rnx_pxny = [];}
if(this.rot_rnx_pxpy == null ||""+this.rot_rnx_pxpy == "undefined"){this.rot_rnx_pxpy = [];}
if(this.rot_rny_nxny == null ||""+this.rot_rny_nxny == "undefined"){this.rot_rny_nxny = [];}
if(this.rot_rny_nxpy == null ||""+this.rot_rny_nxpy == "undefined"){this.rot_rny_nxpy = [];}
if(this.rot_rny_pxny == null ||""+this.rot_rny_pxny == "undefined"){this.rot_rny_pxny = [];}
if(this.rot_rny_pxpy == null ||""+this.rot_rny_pxpy == "undefined"){this.rot_rny_pxpy = [];}
if(this.rot_rpx_nxny == null ||""+this.rot_rpx_nxny == "undefined"){this.rot_rpx_nxny = [];}
if(this.rot_rpx_nxpy == null ||""+this.rot_rpx_nxpy == "undefined"){this.rot_rpx_nxpy = [];}
if(this.rot_rpx_pxny == null ||""+this.rot_rpx_pxny == "undefined"){this.rot_rpx_pxny = [];}
if(this.rot_rpx_pxpy == null ||""+this.rot_rpx_pxpy == "undefined"){this.rot_rpx_pxpy = [];}
if(this.rot_rpy_nxny == null ||""+this.rot_rpy_nxny == "undefined"){this.rot_rpy_nxny = [];}
if(this.rot_rpy_nxpy == null ||""+this.rot_rpy_nxpy == "undefined"){this.rot_rpy_nxpy = [];}
if(this.rot_rpy_pxny == null ||""+this.rot_rpy_pxny == "undefined"){this.rot_rpy_pxny = [];}
if(this.rot_rpy_pxpy == null ||""+this.rot_rpy_pxpy == "undefined"){this.rot_rpy_pxpy = [];}
}

public function load()
{
this.init();
}

public function randgen_ids():String
{
var rand:Int = Std.int(Math.floor(Math.random()*10.999));
var ocu: Float = Math.random(); 
if(ocu > 0.94)
{
if(rand == 0){return "tru_1a";}
else if(rand == 1){return "tru_1b";}
else if(rand == 2){return "tru_1c";}
else if(rand == 3){return "tru_2a";}
else if(rand == 4){return "tru_2b";}
else if(rand == 5){return "tru_2c";}
else if(rand == 6){return "tru_3a";}
else if(rand == 7){return "tru_3b";}
else if(rand == 8){return "tru_3c";}
else if(rand == 9){return "tru_2x3a";}
else if(rand ==10){return "tru_2x3b";}
return "";
}
return ""; 
}
public function randgen_rfl():Bool {var a:Float = Math.random(); if(a < 0.5) return false; return true; }
public function randgen_rot():Float{return Math.floor(Math.random()*4) * 90;}

// renderings and on-spot random generations. 
public function rnx(x:Int, ymax:Int, ymin:Int):Void
{ var y:Int = ymin; 
if(x < 0)
{
}
else
{
}
}
public function rny(y:Int, xmax:Int, xmin:Int):Void // render above the upper screen boundary
{ var x:Int = xmin; // from left to right.
var a:String="", b:Bool = false, c:Float =0;   
var create_x:Float, create_y:Float; var sx:Int, sy:Int; var fx:Int, fy:Int; 
if(y < 0)
{
while(x < xmax)
{
if(this.actors_rny[x] == null ||""+this.actors_rny[x]=="undefined"){this.actors_rny[x] =[];}
if(this.actors_rpy[x] == null ||""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x] =[];}
if(x < 0)
{
if(this.ocu_nxny[0-x] == null||""+this.ocu_nxny[0-x] == "undefined"){this.ocu_nxny[0-x]=[];}
if(this.ocu_nxny[0-x][0-y] == null||""+this.ocu_nxny[0-x][0-y] == "undefined"){this.ocu_nxny[0-x][0-y]=false;}
if(this.atr_rny_nxny[0-x] == null||""+this.atr_rny_nxny[0-x] == "undefined"){this.atr_rny_nxny[0-x]=[];} // this direction. 
if(this.ids_rny_nxny[0-x] == null||""+this.ids_rny_nxny[0-x] == "undefined"){this.ids_rny_nxny[0-x]=[];}
if(this.rfl_rny_nxny[0-x] == null||""+this.rfl_rny_nxny[0-x] == "undefined"){this.rfl_rny_nxny[0-x]=[];}
if(this.rot_rny_nxny[0-x] == null||""+this.rot_rny_nxny[0-x] == "undefined"){this.rot_rny_nxny[0-x]=[];}

if(this.atr_rpy_nxny[0-x] == null||""+this.atr_rpy_nxny[0-x] == "undefined"){this.atr_rpy_nxny[0-x]=[];} // opposite direction
if(this.ids_rpy_nxny[0-x] == null||""+this.ids_rpy_nxny[0-x] == "undefined"){this.ids_rpy_nxny[0-x]=[];}
if(this.rfl_rpy_nxny[0-x] == null||""+this.rfl_rpy_nxny[0-x] == "undefined"){this.rfl_rpy_nxny[0-x]=[];}
if(this.rot_rpy_nxny[0-x] == null||""+this.rot_rpy_nxny[0-x] == "undefined"){this.rot_rpy_nxny[0-x]=[];}
if(this.ocu_nxny[0-x][0-y] == false)
{
if(this.atr_rny_nxny[0-x][0-y] == null||""+this.atr_rny_nxny[0-x][0-y] == "undefined"){this.atr_rny_nxny[0-x][0-y]=[];} // temporary empty data. 
if(this.ids_rny_nxny[0-x][0-y] == null||""+this.ids_rny_nxny[0-x][0-y] == "undefined"){this.ids_rny_nxny[0-x][0-y]=this.randgen_ids();}
if(this.rfl_rny_nxny[0-x][0-y] == null||""+this.rfl_rny_nxny[0-x][0-y] == "undefined"){this.rfl_rny_nxny[0-x][0-y]=this.randgen_rfl();}
if(this.rot_rny_nxny[0-x][0-y] == null||""+this.rot_rny_nxny[0-x][0-y] == "undefined"){this.rot_rny_nxny[0-x][0-y]=this.randgen_rot();}
}
else if(this.ids_rny_nxny[0-x][0-y] == null||""+this.ids_rny_nxny[0-x][0-y] == "undefined"){this.ids_rny_nxny[0-x][0-y]="";}
a = this.ids_rny_nxny[0-x][0-y]; b = this.rfl_rny_nxny[0-x][0-y]; c = this.rot_rny_nxny[0-x][0-y]; 
}
else // rny_pxny
{
if(this.ocu_pxny[x] == null||""+this.ocu_pxny[x] == "undefined"){this.ocu_pxny[x]=[];}
if(this.ocu_pxny[x][0-y] == null||""+this.ocu_pxny[x][0-y] == "undefined"){this.ocu_pxny[x][0-y]=false;}
if(this.atr_rny_pxny[x] == null||""+this.atr_rny_pxny[x] == "undefined"){this.atr_rny_pxny[x]=[];} // this direction. 
if(this.ids_rny_pxny[x] == null||""+this.ids_rny_pxny[x] == "undefined"){this.ids_rny_pxny[x]=[];}
if(this.rfl_rny_pxny[x] == null||""+this.rfl_rny_pxny[x] == "undefined"){this.rfl_rny_pxny[x]=[];}
if(this.rot_rny_pxny[x] == null||""+this.rot_rny_pxny[x] == "undefined"){this.rot_rny_pxny[x]=[];}

if(this.atr_rpy_pxny[x] == null||""+this.atr_rpy_pxny[x] == "undefined"){this.atr_rpy_pxny[x]=[];} // o pposite direction
if(this.ids_rpy_pxny[x] == null||""+this.ids_rpy_pxny[x] == "undefined"){this.ids_rpy_pxny[x]=[];}
if(this.rfl_rpy_pxny[x] == null||""+this.rfl_rpy_pxny[x] == "undefined"){this.rfl_rpy_pxny[x]=[];}
if(this.rot_rpy_pxny[x] == null||""+this.rot_rpy_pxny[x] == "undefined"){this.rot_rpy_pxny[x]=[];}

if(this.ocu_pxny[x][0-y] == false)
{
if(this.atr_rny_pxny[x][0-y] == null||""+this.atr_rny_pxny[x][0-y] == "undefined"){this.atr_rny_pxny[x][0-y]=[];} // temporary empty data. 
if(this.ids_rny_pxny[x][0-y] == null||""+this.ids_rny_pxny[x][0-y] == "undefined"){this.ids_rny_pxny[x][0-y]=this.randgen_ids();}
if(this.rfl_rny_pxny[x][0-y] == null||""+this.rfl_rny_pxny[x][0-y] == "undefined"){this.rfl_rny_pxny[x][0-y]=this.randgen_rfl();}
if(this.rot_rny_pxny[x][0-y] == null||""+this.rot_rny_pxny[x][0-y] == "undefined"){this.rot_rny_pxny[x][0-y]=this.randgen_rot();}
}
else if(this.ids_rny_pxny[x][0-y] == null||""+this.ids_rny_pxny[x][0-y] == "undefined"){this.ids_rny_pxny[x][0-y]="";}
a = this.ids_rny_pxny[x][0-y]; b = this.rfl_rny_pxny[x][0-y]; c = this.rot_rny_pxny[x][0-y]; 
if(a != "" && a != null && ""+a != "undefined") // axtor creation process. 
{
create_x = this.half_scew + x*64 + this.offsx; create_y = this.half_sceh + y*64 + this.offsy;  
this.create_actor(a,create_x,create_y,1); this.number_of_objects +=1;
this.actors_rny[x][y] = this.last_created_actor; 
this.actors_rny[x][y].setValue("Object_behav","x",x); this.actors_rny[x][y].setValue("Object_behav","y",y);
if(b == true){this.actors_rny[x][y].growTo(-1,1,0,null);} 
if(c == 90 || c == 270) // rotate actors. 
{
sx = Conte.obdat_size_y(a); sy = Conte.obdat_size_x(a);
this.actors_rny[x][y].spinTo(c,0,null);
if(sx != sy) // move actors into place. 
{
this.actors_rny[x][y].setX(this.actors_rny[x][y].getX() + 32);
this.actors_rny[x][y].setY(this.actors_rny[x][y].getY() - 32);
}
}
else
{
sx = Conte.obdat_size_x(a); sy = Conte.obdat_size_y(a);
}
fx = x + sx - 1; fy = y +1 - sy; 
this.set_ocu_true(fx,x,y,fy);
this.actors_rny[x][y].setValue("Object_behav","fx",fx); this.actors_rny[x][y].setValue("Object_behav","fy",fy);
this.actors_rny[x][y].setValue("Object_behav","sx",sx); this.actors_rny[x][y].setValue("Object_behav","sy",sy);
this.actors_rny[x][y].setValue("Object_behav","render_dir","north");
this.actors_rny[x][y].setY(this.actors_rny[x][y].getY() - (sy -1)* 64); 
this.actors_rpy[x][fy] = this.actors_rny[x][y];
if(fx < 0) // this is for rnx for y < 0;  
{
if(this.atr_rnx_nxny[0-fx] == null ||""+ this.atr_rnx_nxny[0-fx]== "undefined"){this.atr_rnx_nxny[0-fx] = [];} 
if(this.ids_rnx_nxny[0-fx] == null ||""+ this.ids_rnx_nxny[0-fx]== "undefined"){this.ids_rnx_nxny[0-fx] = [];}
if(this.rfl_rnx_nxny[0-fx] == null ||""+ this.rfl_rnx_nxny[0-fx]== "undefined"){this.rfl_rnx_nxny[0-fx] = [];}  
if(this.rot_rnx_nxny[0-fx] == null ||""+ this.rot_rnx_nxny[0-fx]== "undefined"){this.rot_rnx_nxny[0-fx] = [];}  
if(x < 0)
{
if(this.atr_rnx_nxny[0-fx][0-y] == null ||""+ this.atr_rnx_nxny[0-fx][0-x]== "undefined"){this.atr_rnx_nxny[0-fx][0-y] = this.atr_rny_nxny[0-x][0-y];} 
if(this.ids_rnx_nxny[0-fx][0-y] == null ||""+ this.ids_rnx_nxny[0-fx][0-x]== "undefined"){this.atr_rnx_nxny[0-fx][0-y] = this.ids_rny_nxny[0-x][0-y];}
if(this.rfl_rnx_nxny[0-fx][0-y] == null ||""+ this.rfl_rnx_nxny[0-fx][0-x]== "undefined"){this.rfl_rnx_nxny[0-fx][0-y] = this.rfl_rny_nxny[0-x][0-y];}  
if(this.rot_rnx_nxny[0-fx][0-y] == null ||""+ this.rot_rnx_nxny[0-fx][0-x]== "undefined"){this.rot_rnx_nxny[0-fx][0-y] = this.rot_rny_nxny[0-x][0-y];}  
}
else
{
if(this.atr_rnx_nxny[0-fx][0-y] == null ||""+ this.atr_rnx_nxny[0-fx][0-x]== "undefined"){this.atr_rnx_nxny[0-fx][0-y] = this.atr_rny_pxny[x][0-y];} 
if(this.ids_rnx_nxny[0-fx][0-y] == null ||""+ this.ids_rnx_nxny[0-fx][0-x]== "undefined"){this.atr_rnx_nxny[0-fx][0-y] = this.ids_rny_pxny[x][0-y];}
if(this.rfl_rnx_nxny[0-fx][0-y] == null ||""+ this.rfl_rnx_nxny[0-fx][0-x]== "undefined"){this.rfl_rnx_nxny[0-fx][0-y] = this.rfl_rny_pxny[x][0-y];}  
if(this.rot_rnx_nxny[0-fx][0-y] == null ||""+ this.rot_rnx_nxny[0-fx][0-x]== "undefined"){this.rot_rnx_nxny[0-fx][0-y] = this.rot_rny_pxny[x][0-y];}  
}
}
else // rnx_pxny
{
if(this.atr_rnx_pxny[fx] == null ||""+ this.atr_rnx_pxny[fx]== "undefined"){this.atr_rnx_pxny[fx] = [];} 
if(this.ids_rnx_pxny[fx] == null ||""+ this.ids_rnx_pxny[fx]== "undefined"){this.ids_rnx_pxny[fx] = [];}
if(this.rfl_rnx_pxny[fx] == null ||""+ this.rfl_rnx_pxny[fx]== "undefined"){this.rfl_rnx_pxny[fx] = [];}  
if(this.rot_rnx_pxny[fx] == null ||""+ this.rot_rnx_pxny[fx]== "undefined"){this.rot_rnx_pxny[fx] = [];}  

if(x < 0)
{
if(this.atr_rnx_pxny[fx][0-y] == null ||""+ this.atr_rnx_pxny[fx][0-y]== "undefined"){this.atr_rnx_pxny[fx][0-y] = this.atr_rny_nxny[0-x][0-y];} 
if(this.ids_rnx_pxny[fx][0-y] == null ||""+ this.ids_rnx_pxny[fx][0-y]== "undefined"){this.ids_rnx_pxny[fx][0-y] = this.ids_rny_nxny[0-x][0-y];}
if(this.rfl_rnx_pxny[fx][0-y] == null ||""+ this.rfl_rnx_pxny[fx][0-y]== "undefined"){this.rfl_rnx_pxny[fx][0-y] = this.rfl_rny_nxny[0-x][0-y];}  
if(this.rot_rnx_pxny[fx][0-y] == null ||""+ this.rot_rnx_pxny[fx][0-y]== "undefined"){this.rot_rnx_pxny[fx][0-y] = this.rot_rny_nxny[0-x][0-y];}  
}
else
{
if(this.atr_rnx_pxny[fx][0-y] == null ||""+ this.atr_rnx_pxny[fx][0-y]== "undefined"){this.atr_rnx_pxny[fx][0-y] = this.atr_rny_pxny[x][0-y];} 
if(this.ids_rnx_pxny[fx][0-y] == null ||""+ this.ids_rnx_pxny[fx][0-y]== "undefined"){this.ids_rnx_pxny[fx][0-y] = this.ids_rny_pxny[x][0-y];}
if(this.rfl_rnx_pxny[fx][0-y] == null ||""+ this.rfl_rnx_pxny[fx][0-y]== "undefined"){this.rfl_rnx_pxny[fx][0-y] = this.rfl_rny_pxny[x][0-y];}  
if(this.rot_rnx_pxny[fx][0-y] == null ||""+ this.rot_rnx_pxny[fx][0-y]== "undefined"){this.rot_rnx_pxny[fx][0-y] = this.rot_rny_pxny[x][0-y];}  
}
}
if(fy < 0) //with y < 0
{
if(x < 0)
{
if(this.atr_rpy_nxny[0-x]==null||""+ this.atr_rpy_nxny[0-x]=="undefined"){this.atr_rpy_nxny[0-x]=[];} // array refresh; 
if(this.ids_rpy_nxny[0-x]==null||""+ this.ids_rpy_nxny[0-x]=="undefined"){this.ids_rpy_nxny[0-x]=[];}
if(this.rfl_rpy_nxny[0-x]==null||""+ this.rfl_rpy_nxny[0-x]=="undefined"){this.rfl_rpy_nxny[0-x]=[];}
if(this.rot_rpy_nxny[0-x]==null||""+ this.rot_rpy_nxny[0-x]=="undefined"){this.rot_rpy_nxny[0-x]=[];}

if(this.atr_rpy_nxny[0-x][0-fy]==null||""+ this.atr_rpy_nxny[0-x][0-fy]=="undefined"){this.atr_rpy_nxny[0-x][0-fy]=this.atr_rny_nxny[0-x][0-y];} 
if(this.ids_rpy_nxny[0-x][0-fy]==null||""+ this.ids_rpy_nxny[0-x][0-fy]=="undefined"){this.ids_rpy_nxny[0-x][0-fy]=this.ids_rny_nxny[0-x][0-y];}
if(this.rfl_rpy_nxny[0-x][0-fy]==null||""+ this.rfl_rpy_nxny[0-x][0-fy]=="undefined"){this.rfl_rpy_nxny[0-x][0-fy]=this.rfl_rny_nxny[0-x][0-y];}
if(this.rot_rpy_nxny[0-x][0-fy]==null||""+ this.rot_rpy_nxny[0-x][0-fy]=="undefined"){this.rot_rpy_nxny[0-x][0-fy]=this.rot_rny_nxny[0-x][0-y];}
}
else
{
if(this.atr_rpy_pxny[x]==null||""+ this.atr_rpy_pxny[x]=="undefined"){this.atr_rpy_pxny[x]=[];} // array refresh; 
if(this.ids_rpy_pxny[x]==null||""+ this.ids_rpy_pxny[x]=="undefined"){this.ids_rpy_pxny[x]=[];}
if(this.rfl_rpy_pxny[x]==null||""+ this.rfl_rpy_pxny[x]=="undefined"){this.rfl_rpy_pxny[x]=[];}
if(this.rot_rpy_pxny[x]==null||""+ this.rot_rpy_pxny[x]=="undefined"){this.rot_rpy_pxny[x]=[];}

if(this.atr_rpy_pxny[x][0-fy]==null||""+ this.atr_rpy_pxny[x][0-fy]=="undefined"){this.atr_rpy_pxny[x][0-fy]=this.atr_rny_pxny[x][0-y];} // array refresh; 
if(this.ids_rpy_pxny[x][0-fy]==null||""+ this.ids_rpy_pxny[x][0-fy]=="undefined"){this.ids_rpy_pxny[x][0-fy]=this.ids_rny_pxny[x][0-y];}
if(this.rfl_rpy_pxny[x][0-fy]==null||""+ this.rfl_rpy_pxny[x][0-fy]=="undefined"){this.rfl_rpy_pxny[x][0-fy]=this.rfl_rny_pxny[x][0-y];}
if(this.rot_rpy_pxny[x][0-fy]==null||""+ this.rot_rpy_pxny[x][0-fy]=="undefined"){this.rot_rpy_pxny[x][0-fy]=this.rot_rny_pxny[x][0-y];}
}
}
else // for later use. perhaps this will not happen. 
{
if(x < 0)
{
if(this.atr_rpy_nxpy[0-x]==null||""+ this.atr_rpy_nxpy[0-x]=="undefined"){this.atr_rpy_nxpy[0-x]=[];} // array refresh; 
if(this.ids_rpy_nxpy[0-x]==null||""+ this.ids_rpy_nxpy[0-x]=="undefined"){this.ids_rpy_nxpy[0-x]=[];}
if(this.rfl_rpy_nxpy[0-x]==null||""+ this.rfl_rpy_nxpy[0-x]=="undefined"){this.rfl_rpy_nxpy[0-x]=[];}
if(this.rot_rpy_nxpy[0-x]==null||""+ this.rot_rpy_nxpy[0-x]=="undefined"){this.rot_rpy_nxpy[0-x]=[];}

if(this.atr_rpy_nxpy[0-x][fy]==null||""+ this.atr_rpy_nxpy[0-x][fy]=="undefined"){this.atr_rpy_nxpy[0-x][fy]=this.atr_rny_nxny[0-x][0-y];} // array refresh; 
if(this.ids_rpy_nxpy[0-x][fy]==null||""+ this.ids_rpy_nxpy[0-x][fy]=="undefined"){this.ids_rpy_nxpy[0-x][fy]=this.ids_rny_nxny[0-x][0-y];}
if(this.rfl_rpy_nxpy[0-x][fy]==null||""+ this.rfl_rpy_nxpy[0-x][fy]=="undefined"){this.rfl_rpy_nxpy[0-x][fy]=this.rfl_rny_nxny[0-x][0-y];}
if(this.rot_rpy_nxpy[0-x][fy]==null||""+ this.rot_rpy_nxpy[0-x][fy]=="undefined"){this.rot_rpy_nxpy[0-x][fy]=this.rot_rny_nxny[0-x][0-y];}
}
else
{
if(this.atr_rpy_pxpy[x]==null||""+ this.atr_rpy_pxpy[x]=="undefined"){this.atr_rpy_pxpy[x]=[];} // array refresh; 
if(this.ids_rpy_pxpy[x]==null||""+ this.ids_rpy_pxpy[x]=="undefined"){this.ids_rpy_pxpy[x]=[];}
if(this.rfl_rpy_pxpy[x]==null||""+ this.rfl_rpy_pxpy[x]=="undefined"){this.rfl_rpy_pxpy[x]=[];}
if(this.rot_rpy_pxpy[x]==null||""+ this.rot_rpy_pxpy[x]=="undefined"){this.rot_rpy_pxpy[x]=[];}

if(this.atr_rpy_pxpy[x][fy]==null||""+ this.atr_rpy_pxpy[x][fy]=="undefined"){this.atr_rpy_pxpy[x][fy]=this.atr_rny_pxny[x][0-y];} // array refresh; 
if(this.ids_rpy_pxpy[x][fy]==null||""+ this.ids_rpy_pxpy[x][fy]=="undefined"){this.ids_rpy_pxpy[x][fy]=this.ids_rny_pxny[x][0-y];}
if(this.rfl_rpy_pxpy[x][fy]==null||""+ this.rfl_rpy_pxpy[x][fy]=="undefined"){this.rfl_rpy_pxpy[x][fy]=this.rfl_rny_pxny[x][0-y];}
if(this.rot_rpy_pxpy[x][fy]==null||""+ this.rot_rpy_pxpy[x][fy]=="undefined"){this.rot_rpy_pxpy[x][fy]=this.rot_rny_pxny[x][0-y];}
}
}
}
else // when the tiles are empty. where fx and fy are not needed. 
{this.actors_rpy[x][y] = "no actor"; //this.actors_rny[x][y] = "no actor";
if(x < 0)
{
if(this.atr_rnx_nxny[0-x]==null ||""+this.atr_rnx_nxny[0-x]=="undefined"){this.atr_rnx_nxny[0-x]=[];}
if(this.ids_rnx_nxny[0-x]==null||""+this.ids_rnx_nxny[0-x]=="undefined"){this.ids_rnx_nxny[0-x]=[];}
if(this.rfl_rnx_nxny[0-x]==null ||""+this.rfl_rnx_nxny[0-x]=="undefined"){this.rfl_rnx_nxny[0-x]=[];}
if(this.rot_rnx_nxny[0-x]==null||""+this.rot_rnx_nxny[0-x]=="undefined"){this.rot_rnx_nxny[0-x]=[];}
if(this.atr_rpy_nxny[0-x]==null ||""+this.atr_rpy_nxny[0-x]=="undefined"){this.atr_rpy_nxny[0-x]=[];}
if(this.ids_rpy_nxny[0-x]==null||""+this.ids_rpy_nxny[0-x]=="undefined"){this.ids_rpy_nxny[0-x]=[];}
if(this.rfl_rpy_nxny[0-x]==null ||""+this.rfl_rpy_nxny[0-x]=="undefined"){this.rfl_rpy_nxny[0-x]=[];}
if(this.rot_rpy_nxny[0-x]==null||""+this.rot_rpy_nxny[0-x]=="undefined"){this.rot_rpy_nxny[0-x]=[];}
if(this.ids_rnx_nxny[0-x][0-y]==null ||""+this.ids_rnx_nxny[0-x][0-y]=="undefined"){this.ids_rnx_nxny[0-x][0-y]="";}
if(this.ids_rpy_nxny[0-x][0-y]==null ||""+this.ids_rpy_nxny[0-x][0-y]=="undefined"){this.ids_rpy_nxny[0-x][0-y]="";}
}
else
{
if(this.atr_rnx_pxny[x]==null ||""+this.atr_rnx_pxny[x]=="undefined"){this.atr_rnx_pxny[x]=[];}
if(this.ids_rnx_pxny[x]==null ||""+this.ids_rnx_pxny[x]=="undefined"){this.ids_rnx_pxny[x]=[];}
if(this.rfl_rnx_pxny[x]==null ||""+this.rfl_rnx_pxny[x]=="undefined"){this.rfl_rnx_pxny[x]=[];}
if(this.rot_rnx_pxny[x]==null ||""+this.rot_rnx_pxny[x]=="undefined"){this.rot_rnx_pxny[x]=[];}

if(this.atr_rpy_pxny[x]==null ||""+this.atr_rpy_pxny[x]=="undefined"){this.atr_rpy_pxny[x]=[];}
if(this.ids_rpy_pxny[x]==null ||""+this.ids_rpy_pxny[x]=="undefined"){this.ids_rpy_pxny[x]=[];}
if(this.rfl_rpy_pxny[x]==null ||""+this.rfl_rpy_pxny[x]=="undefined"){this.rfl_rpy_pxny[x]=[];}
if(this.rot_rpy_pxny[x]==null ||""+this.rot_rpy_pxny[x]=="undefined"){this.rot_rpy_pxny[x]=[];}

if(this.ids_rnx_pxny[x][0-y]==null ||""+this.ids_rnx_pxny[x][0-y]=="undefined"){this.ids_rnx_pxny[x][0-y]="";}
if(this.ids_rpy_pxny[x][0-y]==null ||""+this.ids_rpy_pxny[x][0-y]=="undefined"){this.ids_rpy_pxny[x][0-y]="";}
}
}
x = x+1; 
}
}
else // if (y >= 0)
{
while(x < xmax)
{
if(this.actors_rny[x] == null ||""+this.actors_rny[x]=="undefined"){this.actors_rny[x] =[];}
if(this.actors_rpy[x] == null ||""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x] =[];}
if(x < 0)
{
if(this.ocu_nxpy[0-x]==null ||""+this.ocu_nxpy[0-x]=="undefined"){this.ocu_nxpy[0-x]=[];}
if(this.ocu_nxpy[0-x][y]==null||""+this.ocu_nxpy[0-x][y]=="undefined"){this.ocu_nxpy[0-x][y]=false;}
if(this.atr_rny_nxpy[0-x]==null||""+this.atr_rny_nxpy[0-x]=="undefined"){this.atr_rny_nxpy[0-x]=[];}
if(this.ids_rny_nxpy[0-x]==null||""+this.ids_rny_nxpy[0-x]=="undefined"){this.ids_rny_nxpy[0-x]=[];}
if(this.rfl_rny_nxpy[0-x]==null||""+this.rfl_rny_nxpy[0-x]=="undefined"){this.rfl_rny_nxpy[0-x]=[];}
if(this.rot_rny_nxpy[0-x]==null||""+this.rot_rny_nxpy[0-x]=="undefined"){this.rot_rny_nxpy[0-x]=[];}
if(this.ocu_nxpy[0-x][y]==false)
{
if(this.atr_rny_nxpy[0-x][y]==null||""+this.atr_rny_nxpy[0-x][y]=="undefined"){this.atr_rny_nxpy[0-x][y]=[];}
if(this.ids_rny_nxpy[0-x][y]==null||""+this.ids_rny_nxpy[0-x][y]=="undefined"){this.ids_rny_nxpy[0-x][y]=this.randgen_ids();}
if(this.rfl_rny_nxpy[0-x][y]==null||""+this.rfl_rny_nxpy[0-x][y]=="undefined"){this.rfl_rny_nxpy[0-x][y]=this.randgen_rfl();}
if(this.rot_rny_nxpy[0-x][y]==null||""+this.rot_rny_nxpy[0-x][y]=="undefined"){this.rot_rny_nxpy[0-x][y]=this.randgen_rot();}
}
else if(this.ids_rny_nxpy[0-x][y]==null||""+this.ids_rny_nxpy[0-x][y]=="undefined"){this.ids_rny_nxpy[0-x][y] ="";}
a = this.ids_rny_nxpy[0-x][y]; b = this.rfl_rny_nxpy[0-x][y]; c = this.rot_rny_nxpy[0-x][y];
}
else
{
if(this.ocu_pxpy[x]==null ||""+this.ocu_pxpy[x]=="undefined"){this.ocu_pxpy[x]=[];}
if(this.ocu_pxpy[x][y]==null ||""+this.ocu_pxpy[x][y]=="undefined"){this.ocu_pxpy[x][y]=false;}
if(this.atr_rny_pxpy[x]==null||""+this.atr_rny_pxpy[x]=="undefined"){this.atr_rny_pxpy[x]=[];}
if(this.ids_rny_pxpy[x]==null||""+this.ids_rny_pxpy[x]=="undefined"){this.ids_rny_pxpy[x]=[];}
if(this.rfl_rny_pxpy[x]==null||""+this.rfl_rny_pxpy[x]=="undefined"){this.rfl_rny_pxpy[x]=[];}
if(this.rot_rny_pxpy[x]==null||""+this.rot_rny_pxpy[x]=="undefined"){this.rot_rny_pxpy[x]=[];}
if(this.ocu_pxpy[x][y]==false)
{
if(this.atr_rny_pxpy[x][y]==null||""+this.atr_rny_pxpy[x][y]=="undefined"){this.atr_rny_pxpy[x][y]=[];}
if(this.ids_rny_pxpy[x][y]==null||""+this.ids_rny_pxpy[x][y]=="undefined"){this.ids_rny_pxpy[x][y]=this.randgen_ids();}
if(this.rfl_rny_pxpy[x][y]==null||""+this.rfl_rny_pxpy[x][y]=="undefined"){this.rfl_rny_pxpy[x][y]=this.randgen_rfl();}
if(this.rot_rny_pxpy[x][y]==null||""+this.rot_rny_pxpy[x][y]=="undefined"){this.rot_rny_pxpy[x][y]=this.randgen_rot();}
}
else if(this.ids_rny_pxpy[x][y]==null||""+this.ids_rny_pxpy[x][y]=="undefined"){this.ids_rny_pxpy[x][y]="";}
a = this.ids_rny_pxpy[x][y]; b = this.rfl_rny_pxpy[x][y]; c = this.rot_rny_pxpy[x][y];
}
if(a != "" && a != null && ""+a != "undefined")
{
create_x = this.half_scew + x*64 + this.offsx; create_y = this.half_sceh + y*64 + this.offsy;
this.create_actor(a,create_x,create_y,1);this.number_of_objects +=1;
this.actors_rny[x][y] = this.last_created_actor;
this.actors_rny[x][y].setValue("Object_behav","x",x); this.actors_rny[x][y].setValue("Object_behav","y",y);
if(b){this.actors_rny[x][y].growTo(-1,1,0,null);}
if(c == 90 || c == 270) // rotate 90 or 270. 
{
sx = Conte.obdat_size_y(a); sy = Conte.obdat_size_x(a);
this.actors_rny[x][y].spinTo(c,0,null);
if(sx != sy){this.actors_rny[x][y].setX(this.actors_rny[x][y].getX() + 32); this.actors_rny[x][y].setY(this.actors_rny[x][y].getY() - 32); }
}
else{sx = Conte.obdat_size_x(a); sy = Conte.obdat_size_y(a);}
this.actors_rny[x][y].setY(this.actors_rny[x][y].getY() - (sy - 1)* 64);
fx = x + sx -1; fy = y - sy +1; 
this.set_ocu_true(fx,x,y,fy);
this.actors_rny[x][y].setValue("Object_behav","fx",fx); this.actors_rny[x][y].setValue("Object_behav","fy",fy);
this.actors_rny[x][y].setValue("Object_behav","sx",sx); this.actors_rny[x][y].setValue("Object_behav","sy",sy);
this.actors_rny[x][y].setValue("Object_behav","render_dir","north");
this.actors_rpy[x][fy] = this.actors_rny[x][y];
if(fx < 0)
{
if(this.atr_rnx_nxpy[0-fx]==null||""+this.atr_rnx_nxpy[0-fx]=="undefined"){this.atr_rnx_nxpy[0-fx]=[];}
if(this.ids_rnx_nxpy[0-fx]==null||""+this.ids_rnx_nxpy[0-fx]=="undefined"){this.ids_rnx_nxpy[0-fx]=[];}
if(this.rfl_rnx_nxpy[0-fx]==null||""+this.rfl_rnx_nxpy[0-fx]=="undefined"){this.rfl_rnx_nxpy[0-fx]=[];}
if(this.rot_rnx_nxpy[0-fx]==null||""+this.rot_rnx_nxpy[0-fx]=="undefined"){this.rot_rnx_nxpy[0-fx]=[];}
if(x < 0)
{
if(this.atr_rnx_nxpy[0-fx][y]==null||""+this.atr_rnx_nxpy[0-fx][y]=="undefined"){this.atr_rnx_nxpy[0-fx][y]=this.atr_rny_nxpy[0-x][y];}
if(this.ids_rnx_nxpy[0-fx][y]==null||""+this.ids_rnx_nxpy[0-fx][y]=="undefined"){this.ids_rnx_nxpy[0-fx][y]=this.ids_rny_nxpy[0-x][y];}
if(this.rfl_rnx_nxpy[0-fx][y]==null||""+this.rfl_rnx_nxpy[0-fx][y]=="undefined"){this.rfl_rnx_nxpy[0-fx][y]=this.rfl_rny_nxpy[0-x][y];}
if(this.rot_rnx_nxpy[0-fx][y]==null||""+this.rot_rnx_nxpy[0-fx][y]=="undefined"){this.rot_rnx_nxpy[0-fx][y]=this.rot_rny_nxpy[0-x][y];}
}
else
{
if(this.atr_rnx_nxpy[0-fx][y]==null||""+this.atr_rnx_nxpy[0-fx][y]=="undefined"){this.atr_rnx_nxpy[0-fx][y]=this.atr_rny_pxpy[x][y];}
if(this.ids_rnx_nxpy[0-fx][y]==null||""+this.ids_rnx_nxpy[0-fx][y]=="undefined"){this.ids_rnx_nxpy[0-fx][y]=this.ids_rny_pxpy[x][y];}
if(this.rfl_rnx_nxpy[0-fx][y]==null||""+this.rfl_rnx_nxpy[0-fx][y]=="undefined"){this.rfl_rnx_nxpy[0-fx][y]=this.rfl_rny_pxpy[x][y];}
if(this.rot_rnx_nxpy[0-fx][y]==null||""+this.rot_rnx_nxpy[0-fx][y]=="undefined"){this.rot_rnx_nxpy[0-fx][y]=this.rot_rny_pxpy[x][y];}
}
}
else
{
if(this.atr_rnx_pxpy[fx]==null||""+this.atr_rnx_pxpy[fx]=="undefined"){this.atr_rnx_pxpy[fx]=[];}
if(this.ids_rnx_pxpy[fx]==null||""+this.ids_rnx_pxpy[fx]=="undefined"){this.ids_rnx_pxpy[fx]=[];}
if(this.rfl_rnx_pxpy[fx]==null||""+this.rfl_rnx_pxpy[fx]=="undefined"){this.rfl_rnx_pxpy[fx]=[];}
if(this.rot_rnx_pxpy[fx]==null||""+this.rot_rnx_pxpy[fx]=="undefined"){this.rot_rnx_pxpy[fx]=[];}
if(x < 0)
{
if(this.atr_rnx_pxpy[fx][y]==null||""+this.atr_rnx_pxpy[fx][y]=="undefined"){this.atr_rnx_pxpy[fx][y]=this.atr_rny_nxpy[0-x][y];}
if(this.ids_rnx_pxpy[fx][y]==null||""+this.ids_rnx_pxpy[fx][y]=="undefined"){this.ids_rnx_pxpy[fx][y]=this.ids_rny_nxpy[0-x][y];}
if(this.rfl_rnx_pxpy[fx][y]==null||""+this.rfl_rnx_pxpy[fx][y]=="undefined"){this.rfl_rnx_pxpy[fx][y]=this.rfl_rny_nxpy[0-x][y];}
if(this.rot_rnx_pxpy[fx][y]==null||""+this.rot_rnx_pxpy[fx][y]=="undefined"){this.rot_rnx_pxpy[fx][y]=this.rot_rny_nxpy[0-x][y];}
}
else
{
if(this.atr_rnx_pxpy[fx][y]==null||""+this.atr_rnx_pxpy[fx][y]=="undefined"){this.atr_rnx_pxpy[fx][y]=this.atr_rny_pxpy[x][y];}
if(this.ids_rnx_pxpy[fx][y]==null||""+this.ids_rnx_pxpy[fx][y]=="undefined"){this.ids_rnx_pxpy[fx][y]=this.ids_rny_pxpy[x][y];}
if(this.rfl_rnx_pxpy[fx][y]==null||""+this.rfl_rnx_pxpy[fx][y]=="undefined"){this.rfl_rnx_pxpy[fx][y]=this.rfl_rny_pxpy[x][y];}
if(this.rot_rnx_pxpy[fx][y]==null||""+this.rot_rnx_pxpy[fx][y]=="undefined"){this.rot_rnx_pxpy[fx][y]=this.rot_rny_pxpy[x][y];}
}
}

if(fy < 0)// for rpy with y > =0 but fy < 0
{
if(x < 0)
{
if(this.atr_rpy_nxny[0-x]==null|| ""+this.atr_rpy_nxny[0-x]=="undefined"){this.atr_rpy_nxny[0-x]=[];}
if(this.ids_rpy_nxny[0-x]==null||""+this.ids_rpy_nxny[0-x]=="undefined"){this.ids_rpy_nxny[0-x]=[];}
if(this.rfl_rpy_nxny[0-x]==null|| ""+this.rfl_rpy_nxny[0-x]=="undefined"){this.rfl_rpy_nxny[0-x]=[];}
if(this.rot_rpy_nxny[0-x]==null||""+this.rot_rpy_nxny[0-x]=="undefined"){this.rot_rpy_nxny[0-x]=[];}
if(this.atr_rpy_nxny[0-x][0-fy]==null || ""+this.atr_rpy_nxny[0-x][0-fy]=="undefined"){this.atr_rpy_nxny[0-x][0-fy]=this.atr_rny_nxpy[0-x][y];}
if(this.ids_rpy_nxny[0-x][0-fy]==null || ""+this.ids_rpy_nxny[0-x][0-fy]=="undefined"){this.ids_rpy_nxny[0-x][0-fy]=this.ids_rny_nxpy[0-x][y];}
if(this.rfl_rpy_nxny[0-x][0-fy]==null || ""+this.rfl_rpy_nxny[0-x][0-fy]=="undefined"){this.rfl_rpy_nxny[0-x][0-fy]=this.rfl_rny_nxpy[0-x][y];}
if(this.rot_rpy_nxny[0-x][0-fy]==null || ""+this.rot_rpy_nxny[0-x][0-fy]=="undefined"){this.rot_rpy_nxny[0-x][0-fy]=this.rot_rny_nxpy[0-x][y];}
}
else
{
if(this.atr_rpy_pxny[x]==null || ""+this.atr_rpy_pxny[x]=="undefined"){this.atr_rpy_pxny[x]=[];}
if(this.ids_rpy_pxny[x]==null || ""+this.ids_rpy_pxny[x]=="undefined"){this.ids_rpy_pxny[x]=[];}
if(this.rfl_rpy_pxny[x]==null || ""+this.rfl_rpy_pxny[x]=="undefined"){this.rfl_rpy_pxny[x]=[];}
if(this.rot_rpy_pxny[x]==null || ""+this.rot_rpy_pxny[x]=="undefined"){this.rot_rpy_pxny[x]=[];}

if(this.atr_rpy_pxny[x][0-fy]==null || ""+this.atr_rpy_pxny[x][0-fy]=="undefined"){this.atr_rpy_pxny[x][0-fy]=this.atr_rny_pxpy[x][y];}
if(this.ids_rpy_pxny[x][0-fy]==null || ""+this.ids_rpy_pxny[x][0-fy]=="undefined"){this.ids_rpy_pxny[x][0-fy]=this.ids_rny_pxpy[x][y];}
if(this.rfl_rpy_pxny[x][0-fy]==null || ""+this.rfl_rpy_pxny[x][0-fy]=="undefined"){this.rfl_rpy_pxny[x][0-fy]=this.rfl_rny_pxpy[x][y];}
if(this.rot_rpy_pxny[x][0-fy]==null || ""+this.rot_rpy_pxny[x][0-fy]=="undefined"){this.rot_rpy_pxny[x][0-fy]=this.rot_rny_pxpy[x][y];}
}
}
else
{
if(x < 0)
{
if(this.atr_rpy_nxpy[0-x]==null||""+this.atr_rpy_nxpy[0-x]=="undefined"){this.atr_rpy_nxpy[0-x]=[];}
if(this.ids_rpy_nxpy[0-x]==null||""+this.ids_rpy_nxpy[0-x]=="undefined"){this.ids_rpy_nxpy[0-x]=[];}
if(this.rfl_rpy_nxpy[0-x]==null || ""+this.rfl_rpy_nxpy[0-x]=="undefined"){this.rfl_rpy_nxpy[0-x]=[];}
if(this.rot_rpy_nxpy[0-x]==null||""+this.rot_rpy_nxpy[0-x]=="undefined"){this.rot_rpy_nxpy[0-x]=[];}

if(this.atr_rpy_nxpy[0-x][fy]==null || ""+this.atr_rpy_nxpy[0-x][fy]=="undefined"){this.atr_rpy_nxpy[0-x][fy]=this.atr_rny_nxpy[0-x][y];}
if(this.ids_rpy_nxpy[0-x][fy]==null || ""+this.ids_rpy_nxpy[0-x][fy]=="undefined"){this.ids_rpy_nxpy[0-x][fy]=this.ids_rny_nxpy[0-x][y];}
if(this.rfl_rpy_nxpy[0-x][fy]==null || ""+this.rfl_rpy_nxpy[0-x][fy]=="undefined"){this.rfl_rpy_nxpy[0-x][fy]=this.rfl_rny_nxpy[0-x][y];}
if(this.rot_rpy_nxpy[0-x][fy]==null || ""+this.rot_rpy_nxpy[0-x][fy]=="undefined"){this.rot_rpy_nxpy[0-x][fy]=this.rot_rny_nxpy[0-x][y];}
}
else
{
if(this.atr_rpy_pxpy[x]==null || ""+this.atr_rpy_pxpy[x]=="undefined"){this.atr_rpy_pxpy[x]=[];}
if(this.ids_rpy_pxpy[x]==null || ""+this.ids_rpy_pxpy[x]=="undefined"){this.ids_rpy_pxpy[x]=[];}
if(this.rfl_rpy_pxpy[x]==null || ""+this.rfl_rpy_pxpy[x]=="undefined"){this.rfl_rpy_pxpy[x]=[];}
if(this.rot_rpy_pxpy[x]==null || ""+this.rot_rpy_pxpy[x]=="undefined"){this.rot_rpy_pxpy[x]=[];}

if(this.atr_rpy_pxpy[x][fy]==null || ""+this.atr_rpy_pxpy[x][fy]=="undefined"){this.atr_rpy_pxpy[x][fy]=this.atr_rny_pxpy[x][y];}
if(this.ids_rpy_pxpy[x][fy]==null || ""+this.ids_rpy_pxpy[x][fy]=="undefined"){this.ids_rpy_pxpy[x][fy]=this.ids_rny_pxpy[x][y];}
if(this.rfl_rpy_pxpy[x][fy]==null || ""+this.rfl_rpy_pxpy[x][fy]=="undefined"){this.rfl_rpy_pxpy[x][fy]=this.rfl_rny_pxpy[x][y];}
if(this.rot_rpy_pxpy[x][fy]==null || ""+this.rot_rpy_pxpy[x][fy]=="undefined"){this.rot_rpy_pxpy[x][fy]=this.rot_rny_pxpy[x][y];}
}
}
}
else
{this.actors_rpy[x][y] = "no actor"; //this.actors_rny[x][y] = "no actor";
if(x < 0)
if(this.atr_rnx_nxpy[0-x]==null ||""+this.atr_rnx_nxpy[0-x]=="undefined"){this.atr_rnx_nxpy[0-x]=[];}
if(this.ids_rnx_nxpy[0-x]==null||""+this.ids_rnx_nxpy[0-x]=="undefined"){this.ids_rnx_nxpy[0-x]=[];}
if(this.rfl_rnx_nxpy[0-x]==null ||""+this.rfl_rnx_nxpy[0-x]=="undefined"){this.rfl_rnx_nxpy[0-x]=[];}
if(this.rot_rnx_nxpy[0-x]==null||""+this.rot_rnx_nxpy[0-x]=="undefined"){this.rot_rnx_nxpy[0-x]=[];}
if(this.atr_rpy_nxpy[0-x]==null ||""+this.atr_rpy_nxpy[0-x]=="undefined"){this.atr_rpy_nxpy[0-x]=[];}
if(this.ids_rpy_nxpy[0-x]==null||""+this.ids_rpy_nxpy[0-x]=="undefined"){this.ids_rpy_nxpy[0-x]=[];}
if(this.rfl_rpy_nxpy[0-x]==null ||""+this.rfl_rpy_nxpy[0-x]=="undefined"){this.rfl_rpy_nxpy[0-x]=[];}
if(this.rot_rpy_nxpy[0-x]==null||""+this.rot_rpy_nxpy[0-x]=="undefined"){this.rot_rpy_nxpy[0-x]=[];}

if(this.ids_rnx_nxpy[0-x][y]==null ||""+this.ids_rnx_nxpy[0-x][y]=="undefined"){this.ids_rnx_nxpy[0-x][y]="";}
if(this.ids_rpy_nxpy[0-x][y]==null ||""+this.ids_rpy_nxpy[0-x][y]=="undefined"){this.ids_rpy_nxpy[0-x][y]="";} 
}
else
if(this.atr_rnx_pxpy[x]==null ||""+this.atr_rnx_pxpy[x]=="undefined"){this.atr_rnx_pxpy[x]=[];}
if(this.ids_rnx_pxpy[x]==null ||""+this.ids_rnx_pxpy[x]=="undefined"){this.ids_rnx_pxpy[x]=[];}
if(this.rfl_rnx_pxpy[x]==null ||""+this.rfl_rnx_pxpy[x]=="undefined"){this.rfl_rnx_pxpy[x]=[];}
if(this.rot_rnx_pxpy[x]==null ||""+this.rot_rnx_pxpy[x]=="undefined"){this.rot_rnx_pxpy[x]=[];}

if(this.atr_rpy_pxpy[x]==null ||""+this.atr_rpy_pxpy[x]=="undefined"){this.atr_rpy_pxpy[x]=[];}
if(this.ids_rpy_pxpy[x]==null ||""+this.ids_rpy_pxpy[x]=="undefined"){this.ids_rpy_pxpy[x]=[];}
if(this.rfl_rpy_pxpy[x]==null ||""+this.rfl_rpy_pxpy[x]=="undefined"){this.rfl_rpy_pxpy[x]=[];}
if(this.rot_rpy_pxpy[x]==null ||""+this.rot_rpy_pxpy[x]=="undefined"){this.rot_rpy_pxpy[x]=[];}

if(this.ids_rnx_pxpy[x][y]==null ||""+this.ids_rnx_pxpy[x][y]=="undefined"){this.ids_rnx_pxpy[x][y]="";}
if(this.ids_rpy_pxpy[x][y]==null ||""+this.ids_rpy_pxpy[x][y]=="undefined"){this.ids_rpy_pxpy[x][y]="";} 
}
}
x = x+1; 
}
}
public function rpx(x:Int, ymax:Int, ymin:Int):Void // here we use rpy. since rpx uses the same rendering point in 
{ var y:Int = ymin; var a:String=""; var b:Bool= false, c:Float=0; var create_x:Float, create_y:Float; var fx:Int, fy:Int; var dd:Float, sx:Int=1, sy:Int=1; 
  if(this.actors_rpy[x]==null||""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x]=[];}
  if(this.actors_rny[x]==null||""+this.actors_rny[x]=="undefined"){this.actors_rny[x]=[];}
if(x < 0) // rpx for x < 0
{
while(y < ymax)
{
if(y < 0)
{
}
else
{
}
y = y+1; 
}
}
else // rpx for x >=0 
{
while(y < ymax)
{
if(y < 0)
{
}
else
{
}
y = y+1; 
}
}
}

public function rpy(y:Int, xmax:Int, xmin:Int):Void // render below the lower screen boundary - Default initialisation. 
var x:Int = xmin; var a:String, b:Bool, c:Float, d:Float; var create_x:Float, create_y:Float; 
var fx:Int, fy:Int, sx:Int=0, sy:Int=0; // for opposite renfering direction. 
if(y < 0)
{
while(x < xmax)
{
if(this.actors_rpy[x]==null ||""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x]=[];}
if(this.actors_rny[x]==null ||""+this.actors_rny[x]=="undefined"){this.actors_rny[x]=[];}
if(x < 0)
{
if(this.ocu_nxny[0-x]==null || ""+this.ocu_nxny[0-x]=="undenfined"){this.ocu_nxny[0-x]=[];}
if(this.ocu_nxny[0-x][0-y]==null || ""+this.ocu_nxny[0-x][0-y]=="undenfined"){this.ocu_nxny[0-x][0-y]=false;}
if(this.atr_rpy_nxny[0-x]==null||""+this.atr_rpy_nxny[0-x]=="undefined"){this.atr_rpy_nxny[0-x]=[];}
if(this.ids_rpy_nxny[0-x]==null||""+this.ids_rpy_nxny[0-x]=="undefined"){this.ids_rpy_nxny[0-x]=[];}
if(this.rfl_rpy_nxny[0-x]== null ||""+this.rfl_rpy_nxny[0-x]=="undefined"){this.rfl_rpy_nxny[0-x]=[];}
if(this.rot_rpy_nxny[0-x]==null||""+this.rot_rpy_nxny[0-x]=="undefined"){this.rot_rpy_nxny[0-x]=[];}

if(this.ocu_nxny[0-x][0-y] == false)
{
if(this.atr_rpy_nxny[0-x][0-y] == null ||""+this.atr_rpy_nxny[0-x][0-y]=="undefined"){this.atr_rpy_nxny[0-x][0-y]=[];}
if(this.ids_rpy_nxny[0-x][0-y] == null ||""+this.ids_rpy_nxny[0-x][0-y]=="undefined"){this.ids_rpy_nxny[0-x][0-y]=this.randgen_ids();}
if(this.rfl_rpy_nxny[0-x][0-y] == null ||""+this.rfl_rpy_nxny[0-x][0-y]=="undefined"){this.rfl_rpy_nxny[0-x][0-y]=this.randgen_rfl();}
if(this.rot_rpy_nxny[0-x][0-y] == null ||""+this.rot_rpy_nxny[0-x][0-y]=="undefined"){this.rot_rpy_nxny[0-x][0-y]=this.randgen_rot();}
}
else if(this.ids_rpy_nxny[0-x][0-y] == null ||""+this.ids_rpy_nxny[0-x][0-y]=="undefined"){this.ids_rpy_nxny[0-x][0-y]="";}
a = this.ids_rpy_nxny[0-x][0-y]; b = this.rfl_rpy_nxny[0-x][0-y]; c = this.rot_rpy_nxny[0-x][0-y];
}
else
{
if(this.ocu_pxny[x]==null || ""+this.ocu_pxny[x]=="undenfined"){this.ocu_pxny[x]=[];}
if(this.ocu_pxny[x][0-y]==null||""+this.ocu_pxny[x][0-y]=="undenfined"){this.ocu_pxny[x][0-y]=false;}

if(this.atr_rpy_pxny[x] == null ||""+this.atr_rpy_pxny[x]=="undefined"){this.atr_rpy_pxny[x]=[];}
if(this.ids_rpy_pxny[x] == null ||""+this.ids_rpy_pxny[x]=="undefined"){this.ids_rpy_pxny[x]=[];}
if(this.rfl_rpy_pxny[x] == null ||""+this.rfl_rpy_pxny[x]=="undefined"){this.rfl_rpy_pxny[x]=[];}
if(this.rot_rpy_pxny[x] == null ||""+this.rot_rpy_pxny[x]=="undefined"){this.rot_rpy_pxny[x]=[];}

if(this.ocu_pxny[x][0-y] == false)
{
if(this.atr_rpy_pxny[x][0-y]==null||""+this.atr_rpy_pxny[x][0-y]=="undefined"){this.atr_rpy_pxny[x][0-y]=[];}
if(this.ids_rpy_pxny[x][0-y] == null ||""+this.ids_rpy_pxny[x][0-y]=="undefined"){this.ids_rpy_pxny[x][0-y]=this.randgen_ids();}
if(this.rfl_rpy_pxny[x][0-y] == null ||""+this.rfl_rpy_pxny[x][0-y]=="undefined"){this.rfl_rpy_pxny[x][0-y]=this.randgen_rfl();}
if(this.rot_rpy_pxny[x][0-y] == null ||""+this.rot_rpy_pxny[x][0-y]=="undefined"){this.rot_rpy_pxny[x][0-y]=this.randgen_rot();}
}
else if(this.ids_rpy_pxny[x][0-y] == null ||""+this.ids_rpy_pxny[x][0-y]=="undefined"){this.ids_rpy_pxny[x][0-y]="";}
a = this.ids_rpy_pxny[x][0-y]; b = this.rfl_rpy_pxny[x][0-y]; c = this.rot_rpy_pxny[x][0-y];
}
if(a != "" && ""+a != "undefined" && a != null)
{
create_x = this.half_scew + x*64 + this.offsx; create_y = this.half_sceh + y*64 + this.offsy;
this.create_actor(a,create_x,create_y,1);this.number_of_objects +=1;
this.actors_rpy[x][y]=this.last_created_actor;
if(b){this.actors_rpy[x][y].growTo(-1,1,0,null);}
if(c == 90 || c == 270)
{
sx = Conte.obdat_size_y(a); sy = Conte.obdat_size_x(a);
this.actors_rpy[x][y].spinTo(c,0,null);
if(sx != sy){this.actors_rpy[x][y].setX(this.actors_rpy[x][y].getX() + (sx-sy)*32); this.actors_rpy[x][y].setY(this.actors_rpy[x][y].getY() - (sx-sy)*32);}
}
else
{
sx = Conte.obdat_size_x(a); sy = Conte.obdat_size_y(a);
}
fx = x + sx-1; fy = y + sy -1;
this.actors_rpy[x][y].setValue("Object_behav","fx",fx); this.actors_rpy[x][y].setValue("Object_behav","fy",fy);
this.actors_rpy[x][y].setValue("Object_behav","sx",sx); this.actors_rpy[x][y].setValue("Object_behav","sy",sy);
this.actors_rpy[x][y].setValue("Object_behav","render_dir","south");
this.actors_rny[x][fy] = this.actors_rpy[x][y]; 
this.set_ocu_true(fx,x,fy,y);
if(fx < 0)
{
if(this.atr_rnx_nxny[0-fx]==null||""+this.atr_rnx_nxny[0-fx]=="undefined"){this.atr_rnx_nxny[0-fx]=[];}
if(this.ids_rnx_nxny[0-fx]==null||""+this.ids_rnx_nxny[0-fx]=="undefined"){this.ids_rnx_nxny[0-fx]=[];}
if(this.rfl_rnx_nxny[0-fx]==null ||""+this.rfl_rnx_nxny[0-fx]=="undefined"){this.rfl_rnx_nxny[0-fx]=[];}
if(this.rot_rnx_nxny[0-fx]==null ||""+this.rot_rnx_nxny[0-fx]=="undefined"){this.rot_rnx_nxny[0-fx]=[];}
if(x < 0)
{
if(this.atr_rnx_nxny[0-fx][0-y]== null ||""+this.atr_rnx_nxny[0-fx][0-y]=="undefined"){this.atr_rnx_nxny[0-fx][0-y]=this.atr_rpy_nxny[0-x][0-y];}
if(this.ids_rnx_nxny[0-fx][0-y]== null ||""+this.ids_rnx_nxny[0-fx][0-y]=="undefined"){this.ids_rnx_nxny[0-fx][0-y]=this.ids_rpy_nxny[0-x][0-y];}
if(this.rfl_rnx_nxny[0-fx][0-y]== null ||""+this.rfl_rnx_nxny[0-fx][0-y]=="undefined"){this.rfl_rnx_nxny[0-fx][0-y]=this.rfl_rpy_nxny[0-x][0-y];}
if(this.rot_rnx_nxny[0-fx][0-y]== null ||""+this.rot_rnx_nxny[0-fx][0-y]=="undefined"){this.rot_rnx_nxny[0-fx][0-y]=this.rot_rpy_nxny[0-x][0-y];}
}
else
{
if(this.atr_rnx_nxny[0-fx][0-y]== null ||""+this.atr_rnx_nxny[0-fx][0-y]=="undefined"){this.atr_rnx_nxny[0-fx][0-y]=this.atr_rpy_pxny[x][0-y];}
if(this.ids_rnx_nxny[0-fx][0-y]== null ||""+this.ids_rnx_nxny[0-fx][0-y]=="undefined"){this.ids_rnx_nxny[0-fx][0-y]=this.ids_rpy_pxny[x][0-y];}
if(this.rfl_rnx_nxny[0-fx][0-y]== null ||""+this.rfl_rnx_nxny[0-fx][0-y]=="undefined"){this.rfl_rnx_nxny[0-fx][0-y]=this.rfl_rpy_pxny[x][0-y];}
if(this.rot_rnx_nxny[0-fx][0-y]== null ||""+this.rot_rnx_nxny[0-fx][0-y]=="undefined"){this.rot_rnx_nxny[0-fx][0-y]=this.rot_rpy_pxny[x][0-y];}
}
}
else
{
if(this.atr_rnx_pxny[fx]== null ||""+this.atr_rnx_pxny[fx]=="undefined"){this.atr_rnx_pxny[fx]=[];}
if(this.ids_rnx_pxny[fx]== null ||""+this.ids_rnx_pxny[fx]=="undefined"){this.ids_rnx_pxny[fx]=[];}
if(this.rfl_rnx_pxny[fx]== null ||""+this.rfl_rnx_pxny[fx]=="undefined"){this.rfl_rnx_pxny[fx]=[];}
if(this.rot_rnx_pxny[fx]== null ||""+this.rot_rnx_pxny[fx]=="undefined"){this.rot_rnx_pxny[fx]=[];}
if(x < 0)
{
if(this.atr_rnx_pxny[fx][0-y]== null ||""+this.atr_rnx_pxny[fx][0-y]=="undefined"){this.atr_rnx_pxny[fx][0-y]=this.atr_rpy_nxny[0-x][0-y];}
if(this.ids_rnx_pxny[fx][0-y]== null ||""+this.ids_rnx_pxny[fx][0-y]=="undefined"){this.ids_rnx_pxny[fx][0-y]=this.ids_rpy_nxny[0-x][0-y];}
if(this.rfl_rnx_pxny[fx][0-y]== null ||""+this.rfl_rnx_pxny[fx][0-y]=="undefined"){this.rfl_rnx_pxny[fx][0-y]=this.rfl_rpy_nxny[0-x][0-y];}
if(this.rot_rnx_pxny[fx][0-y]== null ||""+this.rot_rnx_pxny[fx][0-y]=="undefined"){this.rot_rnx_pxny[fx][0-y]=this.rot_rpy_nxny[0-x][0-y];}
}
else
{
if(this.atr_rnx_pxny[fx][0-y]== null ||""+this.atr_rnx_pxny[fx][0-y]=="undefined"){this.atr_rnx_pxny[fx][0-y]=this.atr_rpy_pxny[x][0-y];}
if(this.ids_rnx_pxny[fx][0-y]== null ||""+this.ids_rnx_pxny[fx][0-y]=="undefined"){this.ids_rnx_pxny[fx][0-y]=this.ids_rpy_pxny[x][0-y];}
if(this.rfl_rnx_pxny[fx][0-y]== null ||""+this.rfl_rnx_pxny[fx][0-y]=="undefined"){this.rfl_rnx_pxny[fx][0-y]=this.rfl_rpy_pxny[x][0-y];}
if(this.rot_rnx_pxny[fx][0-y]== null ||""+this.rot_rnx_pxny[fx][0-y]=="undefined"){this.rot_rnx_pxny[fx][0-y]=this.rot_rpy_pxny[x][0-y];}
}
}

if (fy < 0) // for rny with y < 0 
{
if(x < 0)
{
if(this.atr_rny_nxny[0-x]==null||""+this.atr_rny_nxny[0-x]=="undefined"){this.atr_rny_nxny[0-x]=[];}
if(this.ids_rny_nxny[0-x]==null||""+this.ids_rny_nxny[0-x]=="undefined"){this.ids_rny_nxny[0-x]=[];}
if(this.rfl_rny_nxny[0-x]==null||""+this.rfl_rny_nxny[0-x]=="undefined"){this.rfl_rny_nxny[0-x]=[];}
if(this.rot_rny_nxny[0-x]==null||""+this.rot_rny_nxny[0-x]=="undefined"){this.rot_rny_nxny[0-x]=[];}

if(this.atr_rny_nxny[0-x][0-fy]==null||""+this.atr_rny_nxny[0-x][0-fy]=="undefined"){this.atr_rny_nxny[0-x][0-fy]=this.atr_rpy_nxny[0-x][0-y];}
if(this.ids_rny_nxny[0-x][0-fy]==null||""+this.ids_rny_nxny[0-x][0-fy]=="undefined"){this.ids_rny_nxny[0-x][0-fy]=this.ids_rpy_nxny[0-x][0-y];}
if(this.rfl_rny_nxny[0-x][0-fy]==null||""+this.rfl_rny_nxny[0-x][0-fy]=="undefined"){this.rfl_rny_nxny[0-x][0-fy]=this.rfl_rpy_nxny[0-x][0-y];}
if(this.rot_rny_nxny[0-x][0-fy]==null||""+this.rot_rny_nxny[0-x][0-fy]=="undefined"){this.rot_rny_nxny[0-x][0-fy]=this.rot_rpy_nxny[0-x][0-y];}
}
else
{
if(this.atr_rny_pxny[x]==null||""+this.atr_rny_pxny[x]=="undefined"){this.atr_rny_pxny[x]=[];}
if(this.ids_rny_pxny[x]==null||""+this.ids_rny_pxny[x]=="undefined"){this.ids_rny_pxny[x]=[];}
if(this.rfl_rny_pxny[x]==null||""+this.rfl_rny_pxny[x]=="undefined"){this.rfl_rny_pxny[x]=[];}
if(this.rot_rny_pxny[x]==null||""+this.rot_rny_pxny[x]=="undefined"){this.rot_rny_pxny[x]=[];}

if(this.atr_rny_pxny[x][0-fy]==null||""+this.atr_rny_pxny[x][0-fy]=="undefined"){this.atr_rny_pxny[x][0-fy]=this.atr_rpy_pxny[x][0-y];}
if(this.ids_rny_pxny[x][0-fy]==null||""+this.ids_rny_pxny[x][0-fy]=="undefined"){this.ids_rny_pxny[x][0-fy]=this.ids_rpy_pxny[x][0-y];}
if(this.rfl_rny_pxny[x][0-fy]==null||""+this.rfl_rny_pxny[x][0-fy]=="undefined"){this.rfl_rny_pxny[x][0-fy]=this.rfl_rpy_pxny[x][0-y];}
if(this.rot_rny_pxny[x][0-fy]==null||""+this.rot_rny_pxny[x][0-fy]=="undefined"){this.rot_rny_pxny[x][0-fy]=this.rot_rpy_pxny[x][0-y];}
}
}
else
{
if(x < 0)
{
if(this.atr_rny_nxpy[0-x]==null||""+this.atr_rny_nxpy[0-x]=="undefined"){this.atr_rny_nxpy[0-x]=[];}
if(this.ids_rny_nxpy[0-x]==null||""+this.ids_rny_nxpy[0-x]=="undefined"){this.ids_rny_nxpy[0-x]=[];}
if(this.rfl_rny_nxpy[0-x]==null||""+this.rfl_rny_nxpy[0-x]=="undefined"){this.rfl_rny_nxpy[0-x]=[];}
if(this.rot_rny_nxpy[0-x]==null||""+this.rot_rny_nxpy[0-x]=="undefined"){this.rot_rny_nxpy[0-x]=[];}

if(this.atr_rny_nxpy[0-x][fy]==null||""+this.atr_rny_nxpy[0-x][fy]=="undefined"){this.atr_rny_nxpy[0-x][fy]=this.atr_rpy_nxny[0-x][0-y];}
if(this.ids_rny_nxpy[0-x][fy]==null||""+this.ids_rny_nxpy[0-x][fy]=="undefined"){this.ids_rny_nxpy[0-x][fy]=this.ids_rpy_nxny[0-x][0-y];}
if(this.rfl_rny_nxpy[0-x][fy]==null||""+this.rfl_rny_nxpy[0-x][fy]=="undefined"){this.rfl_rny_nxpy[0-x][fy]=this.rfl_rpy_nxny[0-x][0-y];}
if(this.rot_rny_nxpy[0-x][fy]==null||""+this.rot_rny_nxpy[0-x][fy]=="undefined"){this.rot_rny_nxpy[0-x][fy]=this.rot_rpy_nxny[0-x][0-y];}
}
else
{
if(this.atr_rny_pxpy[x]==null||""+this.atr_rny_pxpy[x]=="undefined"){this.atr_rny_pxpy[x]=[];}
if(this.ids_rny_pxpy[x]==null||""+this.ids_rny_pxpy[x]=="undefined"){this.ids_rny_pxpy[x]=[];}
if(this.rfl_rny_pxpy[x]==null||""+this.rfl_rny_pxpy[x]=="undefined"){this.rfl_rny_pxpy[x]=[];}
if(this.rot_rny_pxpy[x]==null||""+this.rot_rny_pxpy[x]=="undefined"){this.rot_rny_pxpy[x]=[];}

if(this.atr_rny_pxpy[x][fy]==null||""+this.atr_rny_pxpy[x][fy]=="undefined"){this.atr_rny_pxpy[x][fy]=this.atr_rpy_pxny[x][0-y];}
if(this.ids_rny_pxpy[x][fy]==null||""+this.ids_rny_pxpy[x][fy]=="undefined"){this.ids_rny_pxpy[x][fy]=this.ids_rpy_pxny[x][0-y];}
if(this.rfl_rny_pxpy[x][fy]==null||""+this.rfl_rny_pxpy[x][fy]=="undefined"){this.rfl_rny_pxpy[x][fy]=this.rfl_rpy_pxny[x][0-y];}
if(this.rot_rny_pxpy[x][fy]==null||""+this.rot_rny_pxpy[x][fy]=="undefined"){this.rot_rny_pxpy[x][fy]=this.rot_rpy_pxny[x][0-y];}
}
}
}
else // when the tiles are empty. where fx and fy are not needed. 
{ this.actors_rpy[x][y] = "no actor"; //this.actors_rny[x][y] = "no actor";
if(x < 0)
if(this.atr_rnx_nxny[0-x]==null ||""+this.atr_rnx_nxny[0-x]=="undefined"){this.atr_rnx_nxny[0-x]=[];}
if(this.ids_rnx_nxny[0-x]==null||""+this.ids_rnx_nxny[0-x]=="undefined"){this.ids_rnx_nxny[0-x]=[];}
if(this.rfl_rnx_nxny[0-x]==null ||""+this.rfl_rnx_nxny[0-x]=="undefined"){this.rfl_rnx_nxny[0-x]=[];}
if(this.rot_rnx_nxny[0-x]==null||""+this.rot_rnx_nxny[0-x]=="undefined"){this.rot_rnx_nxny[0-x]=[];}
if(this.atr_rny_nxny[0-x]==null ||""+this.atr_rny_nxny[0-x]=="undefined"){this.atr_rny_nxny[0-x]=[];}
if(this.ids_rny_nxny[0-x]==null||""+this.ids_rny_nxny[0-x]=="undefined"){this.ids_rny_nxny[0-x]=[];}
if(this.rfl_rny_nxny[0-x]==null ||""+this.rfl_rny_nxny[0-x]=="undefined"){this.rfl_rny_nxny[0-x]=[];}
if(this.rot_rny_nxny[0-x]==null||""+this.rot_rny_nxny[0-x]=="undefined"){this.rot_rny_nxny[0-x]=[];}
if(this.ids_rnx_nxny[0-x][0-y]==null ||""+this.ids_rnx_nxny[0-x][0-y]=="undefined"){this.ids_rnx_nxny[0-x][0-y]="";}
if(this.ids_rny_nxny[0-x][0-y]==null ||""+this.ids_rny_nxny[0-x][0-y]=="undefined"){this.ids_rny_nxny[0-x][0-y]="";} 
}
else
if(this.atr_rnx_pxny[x]==null ||""+this.atr_rnx_pxny[x]=="undefined"){this.atr_rnx_pxny[x]=[];}
if(this.ids_rnx_pxny[x]==null ||""+this.ids_rnx_pxny[x]=="undefined"){this.ids_rnx_pxny[x]=[];}
if(this.rfl_rnx_pxny[x]==null ||""+this.rfl_rnx_pxny[x]=="undefined"){this.rfl_rnx_pxny[x]=[];}
if(this.rot_rnx_pxny[x]==null ||""+this.rot_rnx_pxny[x]=="undefined"){this.rot_rnx_pxny[x]=[];}

if(this.atr_rny_pxny[x]==null ||""+this.atr_rny_pxny[x]=="undefined"){this.atr_rny_pxny[x]=[];}
if(this.ids_rny_pxny[x]==null ||""+this.ids_rny_pxny[x]=="undefined"){this.ids_rny_pxny[x]=[];}
if(this.rfl_rny_pxny[x]==null ||""+this.rfl_rny_pxny[x]=="undefined"){this.rfl_rny_pxny[x]=[];}
if(this.rot_rny_pxny[x]==null ||""+this.rot_rny_pxny[x]=="undefined"){this.rot_rny_pxny[x]=[];}

if(this.ids_rnx_pxny[x][0-y]==null ||""+this.ids_rnx_pxny[x][0-x]=="undefined"){this.ids_rnx_pxny[x][0-x]="";}
if(this.ids_rny_pxny[x][0-y]==null ||""+this.ids_rny_pxny[x][0-x]=="undefined"){this.ids_rny_pxny[x][0-x]="";}
}
}
x = x+1; 
}
}
else // for all the positive Y. 
while(x < xmax)
if(this.actors_rpy[x]==null ||""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x]=[];}
if(this.actors_rny[x]==null ||""+this.actors_rny[x]=="undefined"){this.actors_rny[x]=[];}
if(x < 0)
{
if(this.ocu_nxpy[0-x]== null ||""+this.ocu_nxpy[0-x]=="undefined"){this.ocu_nxpy[0-x]=[];}
if(this.ocu_nxpy[0-x][y] == null ||""+this.ocu_nxpy[0-x][y]=="undefined"){this.ocu_nxpy[0-x][y]= false;}

if(this.atr_rpy_nxpy[0-x]==null||""+this.atr_rpy_nxpy[0-x]=="undefined"){this.atr_rpy_nxpy[0-x]=[];}
if(this.ids_rpy_nxpy[0-x]==null||""+this.ids_rpy_nxpy[0-x]=="undefined"){this.ids_rpy_nxpy[0-x]=[];}
if(this.rfl_rpy_nxpy[0-x]==null||""+this.rfl_rpy_nxpy[0-x]=="undefined"){this.rfl_rpy_nxpy[0-x]=[];}
if(this.rot_rpy_nxpy[0-x]==null||""+this.rot_rpy_nxpy[0-x]=="undefined"){this.rot_rpy_nxpy[0-x]=[];}

if(this.ocu_nxpy[0-x][y] == false)
{
if(this.atr_rpy_nxpy[0-x][y]==null||""+this.atr_rpy_nxpy[0-x][y]=="undefined"){this.atr_rpy_nxpy[0-x][y]=[];}
if(this.ids_rpy_nxpy[0-x][y]==null||""+this.ids_rpy_nxpy[0-x][y]=="undefined"){this.ids_rpy_nxpy[0-x][y]=this.randgen_ids();}
if(this.rfl_rpy_nxpy[0-x][y]==null||""+this.rfl_rpy_nxpy[0-x][y]=="undefined"){this.rfl_rpy_nxpy[0-x][y]=this.randgen_rfl();}
if(this.rot_rpy_nxpy[0-x][y]==null||""+this.rot_rpy_nxpy[0-x][y]=="undefined"){this.rot_rpy_nxpy[0-x][y]=this.randgen_rot();}
}
else if(this.ids_rpy_nxpy[0-x][y]==null||""+this.ids_rpy_nxpy[0-x][y]=="undefined"){this.ids_rpy_nxpy[0-x][y]="";}
a = this.ids_rpy_nxpy[0-x][y]; b = this.rfl_rpy_nxpy[0-x][y]; c = this.rot_rpy_nxpy[0-x][y]; 
}
else // undergoing redo. 
{
if(this.ocu_pxpy[x]==null||""+this.ocu_pxpy[x]=="undefined"){this.ocu_pxpy[x]=[];}
if(this.ocu_pxpy[x][y]==null||""+this.ocu_pxpy[x][y]=="undefined"){this.ocu_pxpy[x][y]=false;}

if(this.atr_rpy_pxpy[x]==null ||""+this.atr_rpy_pxpy[x]=="undefined"){this.atr_rpy_pxpy[x]=[];}
if(this.ids_rpy_pxpy[x]==null ||""+this.ids_rpy_pxpy[x]=="undefined"){this.ids_rpy_pxpy[x]=[];}
if(this.rfl_rpy_pxpy[x]==null ||""+this.rfl_rpy_pxpy[x]=="undefined"){this.rfl_rpy_pxpy[x]=[];}
if(this.rot_rpy_pxpy[x]==null ||""+this.rot_rpy_pxpy[x]=="undefined"){this.rot_rpy_pxpy[x]=[];}
if(this.ocu_pxpy[x][y]==false)
{
if(this.atr_rpy_pxpy[x][y]==null ||""+this.atr_rpy_pxpy[x][y]=="undefined"){this.atr_rpy_pxpy[x][y]=[];}
if(this.ids_rpy_pxpy[x][y]==null ||""+this.ids_rpy_pxpy[x][y]=="undefined"){this.ids_rpy_pxpy[x][y]=this.randgen_ids();}
if(this.rfl_rpy_pxpy[x][y]==null ||""+this.rfl_rpy_pxpy[x][y]=="undefined"){this.rfl_rpy_pxpy[x][y]=this.randgen_rfl();}
if(this.rot_rpy_pxpy[x][y]==null ||""+this.rot_rpy_pxpy[x][y]=="undefined"){this.rot_rpy_pxpy[x][y]=this.randgen_rot();}
}
else if(this.ids_rpy_pxpy[x][y]==null ||""+this.ids_rpy_pxpy[x][y]=="undefined"){this.ids_rpy_pxpy[x][y]="";}
a = this.ids_rpy_pxpy[x][y]; b = this.rfl_rpy_pxpy[x][y]; c = this.rot_rpy_pxpy[x][y];  
}
if(a != null && ""+a != "undefined" && a != "")
{
create_x = this.half_scew + x*64 + this.offsx; create_y = this.half_sceh + y*64 + this.offsy;
this.create_actor(a,create_x,create_y,1);this.number_of_objects +=1; this.actors_rpy[x][y]=this.last_created_actor;
if(b){this.actors_rpy[x][y].growTo(-1,1,0,null);}
if(c == 90 || c == 270)
{
sx = Conte.obdat_size_y(a); sy = Conte.obdat_size_x(a);
this.actors_rpy[x][y].spinTo(c,0,null);
if(sx != sy){this.actors_rpy[x][y].setX(this.actors_rpy[x][y].getX() + (sx-sy)*32); this.actors_rpy[x][y].setY(this.actors_rpy[x][y].getY() - (sx-sy)*32);}
}
else{sx = Conte.obdat_size_x(a); sy = Conte.obdat_size_y(a); this.actors_rpy[x][y].spinTo(c,0,null);}
fx = x + sx-1; fy = y + sy -1;
this.actors_rpy[x][y].setValue("Object_behav","fx",fx); this.actors_rpy[x][y].setValue("Object_behav","fy",fy);
this.actors_rpy[x][y].setValue("Object_behav","sx",sx); this.actors_rpy[x][y].setValue("Object_behav","sy",sy);
this.actors_rpy[x][y].setValue("Object_behav","render_dir","south");
this.actors_rny[x][fy] = this.actors_rpy[x][y]; 
this.set_ocu_true(fx,x,fy,y);
if(fx < 0) // for render rnx. 
{
if(this.atr_rnx_nxpy[0-fx]==null || this.atr_rnx_nxpy[0-fx]=="undefined"){this.atr_rnx_nxpy[0-fx]=[];}
if(this.ids_rnx_nxpy[0-fx]==null || this.ids_rnx_nxpy[0-fx]=="undefined"){this.ids_rnx_nxpy[0-fx]=[];}
if(this.rfl_rnx_nxpy[0-fx]==null || this.rfl_rnx_nxpy[0-fx]=="undefined"){this.rfl_rnx_nxpy[0-fx]=[];}
if(this.rot_rnx_nxpy[0-fx]==null || this.rot_rnx_nxpy[0-fx]=="undefined"){this.rot_rnx_nxpy[0-fx]=[];}
if(x < 0)
{
if(this.atr_rnx_nxpy[0-fx][y]==null || this.atr_rnx_nxpy[0-fx][y]=="undefined"){this.atr_rnx_nxpy[0-fx][y]= this.atr_rpy_nxpy[0-x][y];}
if(this.ids_rnx_nxpy[0-fx][y]==null || this.ids_rnx_nxpy[0-fx][y]=="undefined"){this.ids_rnx_nxpy[0-fx][y]= this.ids_rpy_nxpy[0-x][y];}
if(this.rfl_rnx_nxpy[0-fx][y]==null || this.rfl_rnx_nxpy[0-fx][y]=="undefined"){this.rfl_rnx_nxpy[0-fx][y]= this.rfl_rpy_nxpy[0-x][y];}
if(this.rot_rnx_nxpy[0-fx][y]==null || this.rot_rnx_nxpy[0-fx][y]=="undefined"){this.rot_rnx_nxpy[0-fx][y]= this.rot_rpy_nxpy[0-x][y];}
}
else
{
if(this.atr_rnx_nxpy[0-fx][y]==null || this.atr_rnx_nxpy[0-fx][y]=="undefined"){this.atr_rnx_nxpy[0-fx][y]= this.atr_rpy_pxpy[x][y];}
if(this.ids_rnx_nxpy[0-fx][y]==null || this.ids_rnx_nxpy[0-fx][y]=="undefined"){this.ids_rnx_nxpy[0-fx][y]= this.ids_rpy_pxpy[x][y];}
if(this.rfl_rnx_nxpy[0-fx][y]==null || this.rfl_rnx_nxpy[0-fx][y]=="undefined"){this.rfl_rnx_nxpy[0-fx][y]= this.rfl_rpy_pxpy[x][y];}
if(this.rot_rnx_nxpy[0-fx][y]==null || this.rot_rnx_nxpy[0-fx][y]=="undefined"){this.rot_rnx_nxpy[0-fx][y]= this.rot_rpy_pxpy[x][y];}
}
}
else
{
if(this.atr_rnx_pxpy[fx]==null || this.atr_rnx_pxpy[fx]=="undefined"){this.atr_rnx_pxpy[fx]=[];}
if(this.ids_rnx_pxpy[fx]==null || this.ids_rnx_pxpy[fx]=="undefined"){this.ids_rnx_pxpy[fx]=[];}
if(this.rfl_rnx_pxpy[fx]==null || this.rfl_rnx_pxpy[fx]=="undefined"){this.rfl_rnx_pxpy[fx]=[];}
if(this.rot_rnx_pxpy[fx]==null || this.rot_rnx_pxpy[fx]=="undefined"){this.rot_rnx_pxpy[fx]=[];}
if(x < 0)
{
if(this.atr_rnx_pxpy[fx][y]==null || this.atr_rnx_pxpy[fx][y]=="undefined"){this.atr_rnx_pxpy[fx][y]= this.atr_rpy_nxpy[0-x][y];}
if(this.ids_rnx_pxpy[fx][y]==null || this.ids_rnx_pxpy[fx][y]=="undefined"){this.ids_rnx_pxpy[fx][y]= this.ids_rpy_nxpy[0-x][y];}
if(this.rfl_rnx_pxpy[fx][y]==null || this.rfl_rnx_pxpy[fx][y]=="undefined"){this.rfl_rnx_pxpy[fx][y]= this.rfl_rpy_nxpy[0-x][y];}
if(this.rot_rnx_pxpy[fx][y]==null || this.rot_rnx_pxpy[fx][y]=="undefined"){this.rot_rnx_pxpy[fx][y]= this.rot_rpy_nxpy[0-x][y];}
}
else
{
if(this.atr_rnx_pxpy[fx][y]==null || this.atr_rnx_pxpy[fx][y]=="undefined"){this.atr_rnx_pxpy[fx][y]= this.atr_rpy_pxpy[x][y];}
if(this.ids_rnx_pxpy[fx][y]==null || this.ids_rnx_pxpy[fx][y]=="undefined"){this.ids_rnx_pxpy[fx][y]= this.ids_rpy_pxpy[x][y];}
if(this.rfl_rnx_pxpy[fx][y]==null || this.rfl_rnx_pxpy[fx][y]=="undefined"){this.rfl_rnx_pxpy[fx][y]= this.rfl_rpy_pxpy[x][y];}
if(this.rot_rnx_pxpy[fx][y]==null || this.rot_rnx_pxpy[fx][y]=="undefined"){this.rot_rnx_pxpy[fx][y]= this.rot_rpy_pxpy[x][y];}
}
}

if(fy < 0)
{
if(x < 0)
{
if(this.atr_rny_nxny[0-x]==null ||""+this.atr_rny_nxny[0-x]=="undefined"){this.atr_rny_nxny[0-x]=[];}
if(this.ids_rny_nxny[0-x]==null ||""+this.ids_rny_nxny[0-x]=="undefined"){this.ids_rny_nxny[0-x]=[];}
if(this.rfl_rny_nxny[0-x]==null ||""+this.rfl_rny_nxny[0-x]=="undefined"){this.rfl_rny_nxny[0-x]=[];}
if(this.rot_rny_nxny[0-x]==null ||""+this.rot_rny_nxny[0-x]=="undefined"){this.rot_rny_nxny[0-x]=[];}

if(this.atr_rny_nxny[0-x][0-fy]==null ||""+this.atr_rny_nxny[0-x][0-fy]=="undefined"){this.atr_rny_nxny[0-x][0-fy]=this.atr_rpy_nxpy[0-x][y];}
if(this.ids_rny_nxny[0-x][0-fy]==null ||""+this.ids_rny_nxny[0-x][0-fy]=="undefined"){this.ids_rny_nxny[0-x][0-fy]=this.ids_rpy_nxpy[0-x][y];}
if(this.rfl_rny_nxny[0-x][0-fy]==null ||""+this.rfl_rny_nxny[0-x][0-fy]=="undefined"){this.rfl_rny_nxny[0-x][0-fy]=this.rfl_rpy_nxpy[0-x][y];}
if(this.rot_rny_nxny[0-x][0-fy]==null ||""+this.rot_rny_nxny[0-x][0-fy]=="undefined"){this.rot_rny_nxny[0-x][0-fy]=this.rot_rpy_nxpy[0-x][y];}
}
else
{
if(this.atr_rny_pxny[x]==null ||""+this.atr_rny_pxny[x]=="undefined"){this.atr_rny_pxny[x]=[];}
if(this.ids_rny_pxny[x]==null ||""+this.ids_rny_pxny[x]=="undefined"){this.ids_rny_pxny[x]=[];}
if(this.rfl_rny_pxny[x]==null ||""+this.rfl_rny_pxny[x]=="undefined"){this.rfl_rny_pxny[x]=[];}
if(this.rot_rny_pxny[x]==null ||""+this.rot_rny_pxny[x]=="undefined"){this.rot_rny_pxny[x]=[];}

if(this.atr_rny_pxny[x][0-fy]==null ||""+this.atr_rny_pxny[x][0-fy]=="undefined"){this.atr_rny_pxny[x][0-fy]=this.atr_rpy_pxpy[x][y];}
if(this.ids_rny_pxny[x][0-fy]==null ||""+this.ids_rny_pxny[x][0-fy]=="undefined"){this.ids_rny_pxny[x][0-fy]=this.ids_rpy_pxpy[x][y];}
if(this.rfl_rny_pxny[x][0-fy]==null ||""+this.rfl_rny_pxny[x][0-fy]=="undefined"){this.rfl_rny_pxny[x][0-fy]=this.rfl_rpy_pxpy[x][y];}
if(this.rot_rny_pxny[x][0-fy]==null ||""+this.rot_rny_pxny[x][0-fy]=="undefined"){this.rot_rny_pxny[x][0-fy]=this.rot_rpy_pxpy[x][y];}
}
}
else
{
if(x < 0)
if(this.atr_rny_nxpy[0-x]==null ||""+this.atr_rny_nxpy[0-x]=="undefined"){this.atr_rny_nxpy[0-x]=[];}
if(this.ids_rny_nxpy[0-x]==null ||""+this.ids_rny_nxpy[0-x]=="undefined"){this.ids_rny_nxpy[0-x]=[];}
if(this.rfl_rny_nxpy[0-x]==null ||""+this.rfl_rny_nxpy[0-x]=="undefined"){this.rfl_rny_nxpy[0-x]=[];}
if(this.rot_rny_nxpy[0-x]==null ||""+this.rot_rny_nxpy[0-x]=="undefined"){this.rot_rny_nxpy[0-x]=[];}

if(this.atr_rny_nxpy[0-x][fy]==null ||""+this.atr_rny_nxpy[0-x][fy]=="undefined"){this.atr_rny_nxpy[0-x][fy]=this.atr_rpy_nxpy[0-x][y];}
if(this.ids_rny_nxpy[0-x][fy]==null ||""+this.ids_rny_nxpy[0-x][fy]=="undefined"){this.ids_rny_nxpy[0-x][fy]=this.ids_rpy_nxpy[0-x][y];}
if(this.rfl_rny_nxpy[0-x][fy]==null ||""+this.rfl_rny_nxpy[0-x][fy]=="undefined"){this.rfl_rny_nxpy[0-x][fy]=this.rfl_rpy_nxpy[0-x][y];}
if(this.rot_rny_nxpy[0-x][fy]==null ||""+this.rot_rny_nxpy[0-x][fy]=="undefined"){this.rot_rny_nxpy[0-x][fy]=this.rot_rpy_nxpy[0-x][y];}
else
if(this.atr_rny_pxpy[x]==null ||""+this.atr_rny_pxpy[x]=="undefined"){this.atr_rny_pxpy[x]=[];}
if(this.ids_rny_pxpy[x]==null ||""+this.ids_rny_pxpy[x]=="undefined"){this.ids_rny_pxpy[x]=[];}
if(this.rfl_rny_pxpy[x]==null ||""+this.rfl_rny_pxpy[x]=="undefined"){this.rfl_rny_pxpy[x]=[];}
if(this.rot_rny_pxpy[x]==null ||""+this.rot_rny_pxpy[x]=="undefined"){this.rot_rny_pxpy[x]=[];}

if(this.atr_rny_pxpy[x][fy]==null ||""+this.atr_rny_pxpy[x][fy]=="undefined"){this.atr_rny_pxpy[x][fy]=this.atr_rpy_pxpy[x][y];}
if(this.ids_rny_pxpy[x][fy]==null ||""+this.ids_rny_pxpy[x][fy]=="undefined"){this.ids_rny_pxpy[x][fy]=this.ids_rpy_pxpy[x][y];}
if(this.rfl_rny_pxpy[x][fy]==null ||""+this.rfl_rny_pxpy[x][fy]=="undefined"){this.rfl_rny_pxpy[x][fy]=this.rfl_rpy_pxpy[x][y];}
if(this.rot_rny_pxpy[x][fy]==null ||""+this.rot_rny_pxpy[x][fy]=="undefined"){this.rot_rny_pxpy[x][fy]=this.rot_rpy_pxpy[x][y];}
}
}
else
{
this.actors_rpy[x][y] = "no actor"; //this.actors_rny[x][y] = "no actor";
if(x < 0)
{   
if(this.atr_rnx_nxpy[0-x]==null ||""+this.atr_rnx_nxpy[0-x]=="undefined"){this.atr_rnx_nxpy[0-x]=[];}
if(this.ids_rnx_nxpy[0-x]==null ||""+this.ids_rnx_nxpy[0-x]=="undefined"){this.ids_rnx_nxpy[0-x]=[];}
if(this.rfl_rnx_nxpy[0-x]==null ||""+this.rfl_rnx_nxpy[0-x]=="undefined"){this.rfl_rnx_nxpy[0-x]=[];}
if(this.rot_rnx_nxpy[0-x]==null ||""+this.rot_rnx_nxpy[0-x]=="undefined"){this.rot_rnx_nxpy[0-x]=[];}
if(this.atr_rny_nxpy[0-x]==null ||""+this.atr_rny_nxpy[0-x]=="undefined"){this.atr_rny_nxpy[0-x]=[];}
if(this.ids_rny_nxpy[0-x]==null ||""+this.ids_rny_nxpy[0-x]=="undefined"){this.ids_rny_nxpy[0-x]=[];}
if(this.rfl_rny_nxpy[0-x]==null ||""+this.rfl_rny_nxpy[0-x]=="undefined"){this.rfl_rny_nxpy[0-x]=[];}
if(this.rot_rny_nxpy[0-x]==null ||""+this.rot_rny_nxpy[0-x]=="undefined"){this.rot_rny_nxpy[0-x]=[];}

if(this.ids_rnx_nxpy[0-x][y]==null ||""+this.ids_rnx_nxpy[0-x][y]=="undefined"){this.ids_rnx_nxpy[0-x][y]="";}
if(this.ids_rny_nxpy[0-x][y]==null ||""+this.ids_rny_nxpy[0-x][y]=="undefined"){this.ids_rny_nxpy[0-x][y]="";} 
else
if(this.atr_rnx_pxpy[x]==null ||""+this.atr_rnx_pxpy[x]=="undefined"){this.atr_rnx_pxpy[x]=[];}
if(this.ids_rnx_pxpy[x]==null ||""+this.ids_rnx_pxpy[x]=="undefined"){this.ids_rnx_pxpy[x]=[];}
if(this.rfl_rnx_pxpy[x]==null ||""+this.rfl_rnx_pxpy[x]=="undefined"){this.rfl_rnx_pxpy[x]=[];}
if(this.rot_rnx_pxpy[x]==null ||""+this.rot_rnx_pxpy[x]=="undefined"){this.rot_rnx_pxpy[x]=[];}

if(this.atr_rny_pxpy[x]==null ||""+this.atr_rny_pxpy[x]=="undefined"){this.atr_rny_pxpy[x]=[];}
if(this.ids_rny_pxpy[x]==null ||""+this.ids_rny_pxpy[x]=="undefined"){this.ids_rny_pxpy[x]=[];}
if(this.rfl_rny_pxpy[x]==null ||""+this.rfl_rny_pxpy[x]=="undefined"){this.rfl_rny_pxpy[x]=[];}
if(this.rot_rny_pxpy[x]==null ||""+this.rot_rny_pxpy[x]=="undefined"){this.rot_rny_pxpy[x]=[];}

if(this.ids_rnx_pxpy[x][y]==null ||""+this.ids_rnx_pxpy[x][y]=="undefined"){this.ids_rnx_pxpy[x][y]="";}
if(this.ids_rny_pxpy[x][y]==null ||""+this.ids_rny_pxpy[x][y]=="undefined"){this.ids_rny_pxpy[x][y]="";}
x = x+1; 
}
}
public function remo_rnx(){}
public function remo_rny(y:Int, xmax:Int, xmin:Int):Void
{
var x = xmin; 
while (x <= xmax)
{
if(this.actors_rny[x] == null || ""+this.actors_rny[x]=="undefined"){this.actors_rny[x]=[]; this.undefined_kill_list = x;}
if(this.actors_rny[x][y] != null && ""+this.actors_rny[x][y] !="undefined" && this.actors_rny[x][y] != "no actor")
{
Script.recycleActor(this.actors_rny[x][y]);
this.actors_rny[x][y] = "no actor"; 
this.number_of_objects -=1; 
} x=x+1;
}
}
public function remo_rpx(x:Int, ymax:Int, ymin:Int):Void
{
var y:Int = ymin; 
if(this.actors_rpy[x]==null || ""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x]=[];} // remove lines. 
while(y <= ymax)
{
if(this.actors_rpy[x][y] != null && ""+this.actors_rpy[x][y] != "undefined" && this.actors_rpy[x][y] != "no actor")
{
Script.recycleActor(this.actors_rpy[x][y]);
this.actors_rpy[x][y] = "no actor"; 
this.number_of_objects -=1; 
}
y = y+1; 
}
}
public function remo_rpy(y:Int, xmax:Int, xmin:Int):Void
{
var x:Int = xmin; 
while(x <= xmax)
if(this.actors_rpy[x] == null || ""+this.actors_rpy[x] == "undefined") {this.actors_rpy[x] = []; this.undefined_kill_list = x;} 
if(this.actors_rpy[x][y] != null && ""+this.actors_rpy[x][y] != "undefined" && this.actors_rpy[x][y] != "no actor")
{
Script.recycleActor(this.actors_rpy[x][y]);
this.actors_rpy[x][y] = "no actor"; 
this.number_of_objects -=1; 
} x = x+1; 
}
}

public function set_ocu_true(xmax:Int, xmin:Int, ymax:Int, ymin:Int):Void
{
var x:Int = xmin; var y:Int = ymin; 
while(x <= xmax)
{
y = ymin; if(x <= 0)
{
if(this.ocu_nxny[0-x] == null || ""+ this.ocu_nxny[0-x] == "undefined"){this.ocu_nxny[0-x]=[];}
if(this.ocu_nxpy[0-x] == null || ""+ this.ocu_nxpy[0-x] == "undefined"){this.ocu_nxpy[0-x]=[];}
while(y <= ymax)
{
if(y<0){ this.ocu_nxny[0-x][0-y] = true;}
else{ this.ocu_nxpy[0-x][y] = true;}
y = y+1; 
}
}
else
{
if(this.ocu_pxny[x] == null || ""+ this.ocu_pxny[x] == "undefined"){this.ocu_pxny[x]=[];}
if(this.ocu_pxpy[x] == null || ""+ this.ocu_pxpy[x] == "undefined"){this.ocu_pxpy[x]=[];}
while(y <= ymax)
{
if(y <= 0){this.ocu_pxny[x][0-y] = true;}
else{ this.ocu_pxpy[x][y] = true;}
y = y+1; 
}
}
x = x+1; 
}
}

public function shift_nx():Void
{
}

public function shift_ny():Void // while moving the camera upwards
{ for(actorInGroup in cast(Script.getActorGroup(6), Group).list)
{
if(actorInGroup != null && !actorInGroup.dead && !actorInGroup.recycled){
actorInGroup.setY(actorInGroup.getY() - this.half_sceh);
}
}
/*
var xmin:Int = this.initile_xmin; var xmax:Int = this.initile_xmax; 
var ymin:Int = this.initile_ymin; var ymax:Int = this.initile_ymax; 
var x:Int = xmin, y:Int = ymin; 

while(x <= xmax)
{ //if(this.actors_rpy[x]==null||""+this.actors_rpy[x]=="undefined"){this.actors_rpy[x] =[];}
y=ymin; while(y <= ymax)
{
if(this.actors_rpy[x][y] != null && ""+this.actors_rpy[x][y] != "undefined" && this.actors_rpy[x][y] != "no actor"){this.actors_rpy[x][y].setY(this.actors_rpy[x][y].getY() - this.half_sceh);}
y =  y+1; 
}
x = x+1; 
} */
}

public function shift_px():Void
{
}

public function shift_py():Void
{
for(actorInGroup in cast(Script.getActorGroup(6), Group).list)
{
if(actorInGroup != null && !actorInGroup.dead && !actorInGroup.recycled){
actorInGroup.setY(actorInGroup.getY() + this.half_sceh);
}
}
/*
var xmin:Int = this.initile_xmin; var xmax:Int = this.initile_xmax; 
var ymin:Int = this.initile_ymin; var ymax:Int = this.initile_ymax; 
var x:Int = xmin, y:Int = ymin; 

while(x < xmax)
{
y=0; while(y < ymax)
{
this.actors_rpy[x][y].setY(this.actors_rpy[x][y].getY() + this.half_sceh);
y = y+1; 
}
x = x+1; 
}
*/
}
}

}



Wednesday, 7 June 2023

Apologies

Apologies. 
1. Stencyl-nator apologizes that the "endless" scene video is too large to upload onto the blogger. 600MB
2. Longer than expected. Accidentally deleted the game project files and spend some time on Minudstry mods. 
3. No pride month (LGBTQ or pride itself) will be celebrated here. By the way, LGBTQ is illegal in  Malaysia, where Stencyl-nator is operated.  Recently, the Rainbow-themed Swatch has been by confiscated by Malaysian authorities.  
 
Blog update
There are now 3 version of so-called endless scene which is technically not. but it can have up to 2.1 billion tiles from each direction.  The latest ones are in code mode: 
Removed from game mechanics section: 

Added new version 

All of the above are not accessible directly via game mechanics section but all 3 version has become sub-topics of the main page. http://stencyl-nator.blogspot.com/p/endless-scenes.html. the main topic page can be accessed directly to game mechanics.   


The game development progress
The project is remake from zero. except the sprites. This is to optimise and make sure that the game can run in entry-level computers such as Avita Essential 14 with Intel Celeron N4020.  https://www.avita.com/my/product/essential. The project redo is to further optimize the game and bugs and significantly improve performance and efficiency by discarding unwanted finctionality from some scenes and actors as well as the entire project.  

Reasons to restart the project: 
1. Do away with 1.5x, 2x, 3x and 4x via settings.
2. Do away with com.stencyl.graphics.G. 
3. Sprite redesign.   
4. To use mostly code mode with minimum imports where design mode cannot.

First, it was named "Minedew valley" then infinite valley now, prosperity valley. the name of the game might subject to change again. 

the current progress
gameplay - only endless scene generation on 1-unit "terrain" using many actors. Player can only move around. 
 
The tying features for load game discards com.stencyl.graphics.G. Powered by code mode and 
http://stencyl-nator.blogspot.com/p/text-drawing-arbitrary-code-for-stencyl.html and some reverse-engineering from com.stencyl.behavior.Scripts. 

Everthing else not yet. 

Mindustry mods
Stencyl-nator owner has also developed some Mindustry mods
2. Ereki_clones - No enemies, No techs https://github.com/chinhonnang0000/ereki_clones


*No techs means no technology provided by the mods themselves. You need to play the original campaign and other mods to acquire them. That means techs from other mods and original game can be brought in and used.

[1] Uses the default generator which is AsteroidGenerator, [2] and [3] are changed generator via javascript. You can bring techs from originals and other mods to play the 3 mods from github downlodable via the mod browser. Unfortunately, Tantros has been de-listed from the mod browser for unknown reason but most likely being outdated.  

Proposed upcoming topics 
Tips and tricks (will appear on that section once written)
1. Code mode vs design mode. 
2. Unused behaviors

blocks, code and computational "shortcuts" which are important to use code in design mode and full code mode.  

Aside from the Stencyl tutorial related topics, Stencyl-nator will write about the game development progress as soon as some of the game features are ready.  
 
  




Wednesday, 1 February 2023

Not active until may 2023

Stencyl-nator will be inactive until may 2023 so do not expect any new Stencyl topic by this time because The owner is now busy on his academic tasks again and this time, absolutely nothing with game development processes.  

Here is the screenshot of a reverse-engineered javascript of a StencylWork in HTML5 format and still fails to make a StencylWork to run on browser without depending on Stencyl(localhost) or third-party sites such as Kongregate. 


Thursday, 26 January 2023

New topic: Multiple stencyl badges. (HTML5, javascript)

 Story: 
I cannot load the StencylWork after being released to my computer and play it straight with browser (stuck at loading screen when released). so I decided to edit the source files HTML and JS of the StencylWork. So that i can use the StencylWork to develop another StencylWork without going using the internet or publishing to some sites.

So far, Stencyl-nator has not been able to access directly to the Stencyl using direct browser access (localhost).by clicking the HTML5 icon.  However, it work before it released as localhost. 

After a week, we discovered how to remove or have multiple of "Made with Stencyl badges"