package scripts;
import com.stencyl.Engine;
import com.stencyl.models.Actor;
class Object_data
{
public var actors:Array<Dynamic> = []; public var number_of_actors:Int =0; public var stone_density:Float = 0.2;
public var actors_posx:Array<Dynamic> =[]; public var actors_posy:Array<Dynamic>=[]; // these arriays to prevent aliasing.
public var ids_nxny:Array <Dynamic> = []; public var ids_nxpy:Array <Dynamic>= []; public var ids_pxny:Array <Dynamic>= []; public var ids_pxpy:Array <Dynamic>= [];
public var rfl_nxny:Array <Dynamic> = []; public var rfl_nxpy:Array <Dynamic>= []; public var rfl_pxny:Array <Dynamic>= []; public var rfl_pxpy:Array <Dynamic>= [];
public var rot_nxny:Array <Dynamic> = []; public var rot_nxpy:Array <Dynamic>= []; public var rot_pxny:Array <Dynamic>= []; public var rot_pxpy:Array <Dynamic>= [];
public var dec_ids_nxny:Array <Dynamic> = []; public var dec_ids_nxpy:Array <Dynamic> = []; public var dec_ids_pxny:Array <Dynamic> = []; public var dec_ids_pxpy:Array <Dynamic> = [];
public var dec_len_nxny:Array <Dynamic> = []; public var dec_len_nxpy:Array <Dynamic> = []; public var dec_len_pxny:Array <Dynamic> = []; public var dec_len_pxpy:Array <Dynamic> = [];
public var dec_rfl_nxny:Array <Dynamic> = []; public var dec_rfl_nxpy:Array <Dynamic> = []; public var dec_rfl_pxny:Array <Dynamic> = []; public var dec_rfl_pxpy:Array <Dynamic> = [];
public var dec_rot_nxny:Array <Dynamic> = []; public var dec_rot_nxpy:Array <Dynamic> = []; public var dec_rot_pxny:Array <Dynamic> = []; public var dec_rot_pxpy:Array <Dynamic> = [];
public var dec_scl_nxny:Array <Dynamic> = []; public var dec_scl_nxpy:Array <Dynamic> = []; public var dec_scl_pxny:Array <Dynamic> = []; public var dec_scl_pxpy:Array <Dynamic> = [];
public function new(){}
public function create_object(a:String, x:Int,y:Int)
{
var create_x:Float = Engine.cameraX + Engine.screenWidth/2 + (x - S_gameplay_behav.disp_xcen)*512 *S_gameplay_behav.zoom;
var create_y:Float = Engine.cameraY + Engine.screenHeight/2 + (y - S_gameplay_behav.disp_ycen)*512 *S_gameplay_behav.zoom;
if(this.actors[x] == null ||""+this.actors[x] == "undefined"){this.actors[x] = [];}
if(this.actors_posx[x] == null ||""+this.actors_posx[x] == "undefined"){this.actors_posx[x] = [];}
if(this.actors_posy[x] == null ||""+this.actors_posy[x] == "undefined"){this.actors_posy[x] = [];}
this.actors_posx[x][y] = create_x- 256 * (1 - S_gameplay_behav.zoom); this.actors_posy[x][y] = create_y- 256 * (1 - S_gameplay_behav.zoom);
this.actors[x][y] = Engine.engine.getRecycledActorOfTypeOnLayer(Conte.obj_atid(a),create_x,create_y,1); this.number_of_actors +=1;
if(this.get_rfl(x,y)){this.actors[x][y].tweenProps.realScaleXY.tween(-1,S_gameplay_behav.zoom,1,S_gameplay_behav.zoom,null,0);}
else this.actors[x][y].tweenProps.realScaleXY.tween(1,S_gameplay_behav.zoom,1,S_gameplay_behav.zoom,null,0);
this.actors[x][y].setX(this.actors[x][y].getX() - 256 * (1 - S_gameplay_behav.zoom)); this.actors[x][y].setY(this.actors[x][y].getY() - 256 * (1 - S_gameplay_behav.zoom));
this.actors[x][y].setValue("Floor_behav","x",x); this.actors[x][y].setValue("Floor_behav","y",y);
}
public function get_rfl(x,y):Bool
{
if(x < 0)
{
if(y < 0)
{
if(this.rfl_nxny[0-x] == null ||""+this.rfl_nxny[0-x] == "undefined"){return false;}
return this.rfl_nxny[0-x][0-y];
}
else
{
if(this.rfl_nxpy[0-x] == null ||""+this.rfl_nxpy[0-x] == "undefined"){return false;}
return this.rfl_nxpy[0-x][y];
}
}
else
{
if(y < 0)
{
if(this.rfl_pxny[x] == null ||""+this.rfl_pxny[x] == "undefined"){return false;}
return this.rfl_pxny[x][0-y];
}
else
{
if(this.rfl_pxpy[x] == null ||""+this.rfl_pxpy[x] == "undefined"){return false;}
return this.rfl_pxpy[x][y];
}
}
return false;
}
public function init()
{
this.number_of_actors = 0; this.actors = [];
if(this.ids_nxny == null || ""+ this.ids_nxny =="undefined"){this.ids_nxny = [];}
if(this.ids_nxpy == null || ""+ this.ids_nxpy =="undefined"){this.ids_nxpy = [];}
if(this.ids_pxny == null || ""+ this.ids_pxny =="undefined"){this.ids_pxny = [];}
if(this.ids_pxpy == null || ""+ this.ids_pxpy =="undefined"){this.ids_pxpy = [];}
if(this.rfl_nxny == null || ""+ this.rfl_nxny =="undefined"){this.rfl_nxny = [];}
if(this.rfl_nxpy == null || ""+ this.rfl_nxpy =="undefined"){this.rfl_nxpy = [];}
if(this.rfl_pxny == null || ""+ this.rfl_pxny =="undefined"){this.rfl_pxny = [];}
if(this.rfl_pxpy == null || ""+ this.rfl_pxpy =="undefined"){this.rfl_pxpy = [];}
if(this.rot_nxny == null || ""+ this.rot_nxny =="undefined"){this.rot_nxny = [];}
if(this.rot_nxpy == null || ""+ this.rot_nxpy =="undefined"){this.rot_nxpy = [];}
if(this.rot_pxny == null || ""+ this.rot_pxny =="undefined"){this.rot_pxny = [];}
if(this.rot_pxpy == null || ""+ this.rot_pxpy =="undefined"){this.rot_pxpy = [];}
if(this.dec_ids_nxny == null||""+this.dec_ids_nxny == "undefined"){this.dec_ids_nxny = [];}
if(this.dec_ids_nxpy == null||""+this.dec_ids_nxpy == "undefined"){this.dec_ids_nxpy = [];}
if(this.dec_ids_pxny == null||""+this.dec_ids_pxny == "undefined"){this.dec_ids_pxny = [];}
if(this.dec_ids_pxpy == null||""+this.dec_ids_pxpy == "undefined"){this.dec_ids_pxpy = [];}
if(this.dec_len_nxny == null||""+this.dec_len_nxny == "undefined"){this.dec_len_nxny = [];}
if(this.dec_len_nxpy == null||""+this.dec_len_nxpy == "undefined"){this.dec_len_nxpy = [];}
if(this.dec_len_pxny == null||""+this.dec_len_pxny == "undefined"){this.dec_len_pxny = [];}
if(this.dec_len_pxpy == null||""+this.dec_len_pxpy == "undefined"){this.dec_len_pxpy = [];}
if(this.dec_rfl_nxny == null||""+this.dec_rfl_nxny == "undefined"){this.dec_rfl_nxny = [];}
if(this.dec_rfl_nxpy == null||""+this.dec_rfl_nxpy == "undefined"){this.dec_rfl_nxpy = [];}
if(this.dec_rfl_pxny == null||""+this.dec_rfl_pxny == "undefined"){this.dec_rfl_pxny = [];}
if(this.dec_rfl_pxpy == null||""+this.dec_rfl_pxpy == "undefined"){this.dec_rfl_pxpy = [];}
if(this.dec_rot_nxny == null||""+this.dec_rot_nxny == "undefined"){this.dec_rot_nxny = [];}
if(this.dec_rot_nxpy == null||""+this.dec_rot_nxpy == "undefined"){this.dec_rot_nxpy = [];}
if(this.dec_rot_pxny == null||""+this.dec_rot_pxny == "undefined"){this.dec_rot_pxny = [];}
if(this.dec_rot_pxpy == null||""+this.dec_rot_pxpy == "undefined"){this.dec_rot_pxpy = [];}
if(this.dec_scl_nxny == null||""+this.dec_scl_nxny == "undefined"){this.dec_scl_nxny = [];}
if(this.dec_scl_nxpy == null||""+this.dec_scl_nxpy == "undefined"){this.dec_scl_nxpy = [];}
if(this.dec_scl_pxny == null||""+this.dec_scl_pxny == "undefined"){this.dec_scl_pxny = [];}
if(this.dec_scl_pxpy == null||""+this.dec_scl_pxpy == "undefined"){this.dec_scl_pxpy = [];}
}
public function randgen_dec_ids():String
{
var a:Int = Std.int(Math.floor(Math.random()* 4.99));
if(a == 0){return "objdec_stone_0";}
if(a == 1){return "objdec_stone_1";}
if(a == 2){return "objdec_stone_2";}
if(a == 3){return "objdec_stone_3";}
if(a == 4){return "objdec_stone_4";}
return "";
}
public function randgen_ids():String
{
if (Math.random() < this.stone_density)
{
var a:Int = Std.int(Math.floor(Math.random()* 4.99));
if(a == 0){return "obj_stone_0";}
if(a == 1){return "obj_stone_1";}
if(a == 2){return "obj_stone_2";}
if(a == 3){return "obj_stone_3";}
if(a == 4){return "obj_stone_4";}
}
return "";
}
public function randgen_rfl():Bool
{
var a:Float = Math.random();
if(a < 0.5) return false;
else return true;
return false;
}
public function randgen_rot():Int
{
var a:Int = Std.int(Math.floor(Math.random() * 3.99));
if(a==0) return 0;
else if(a==1) return 90;
else if(a==2) return 180;
else if(a==3) return 270;
return 0;
}
public function remo_horz(y,xmin,xmax)
{
var x:Int = xmin;
while(x < xmax)
{
if(this.actors[x]==null ||""+this.actors[x]=="undefined"){}
else if(Std.is(this.actors[x][y],Actor))
{
Engine.engine.recycleActor(this.actors[x][y]); this.actors[x][y] = null;
this.number_of_actors -=1;
}
x = x +1;
}
}
public function remo_vert(x,ymin,ymax)
{
if(this.actors[x]==null ||""+this.actors[x]=="undefined"){return;}
var y:Int = ymin;
while(y < ymax)
{
if(Std.is(this.actors[x][y],Actor))
{
Engine.engine.recycleActor(this.actors[x][y]); this.actors[x][y] = null;
this.number_of_actors -=1;
}
y = y+1;
}
}
public function ren_horz(y:Int,xmin:Int,xmax:Int)
{
var x:Int = xmin;
var ids: String; var rfl:Bool; var rot:Int;
if(y < 0)
{
x = xmin;
while(x < xmax)
{
if(this.actors[x]== null ||""+this.actors == "undefined"){this.actors[x]=[];}
if(this.actors_posx[x] == null ||""+this.actors_posx[x] == "undefined"){this.actors_posx[x] = [];}
if(this.actors_posy[x] == null ||""+this.actors_posy[x] == "undefined"){this.actors_posy[x] = [];}
if(x < 0)
{
if(this.ids_nxny[0-x] == null ||""+this.ids_nxny[0-x]=="undefined"){this.ids_nxny[0-x]=[];}
if(this.rfl_nxny[0-x] == null ||""+this.rfl_nxny[0-x]=="undefined"){this.rfl_nxny[0-x]=[];}
if(this.rot_nxny[0-x] == null ||""+this.rot_nxny[0-x]=="undefined"){this.rot_nxny[0-x]=[];}
if(this.ids_nxny[0-x][0-y] == null ||""+this.ids_nxny[0-x][0-y]=="undefined"){this.ids_nxny[0-x][0-y]=this.randgen_ids();}
if(this.rfl_nxny[0-x][0-y] == null ||""+this.rfl_nxny[0-x][0-y]=="undefined"){this.rfl_nxny[0-x][0-y]=this.randgen_rfl();}
if(this.rot_nxny[0-x][0-y] == null ||""+this.rot_nxny[0-x][0-y]=="undefined"){this.rot_nxny[0-x][0-y]=this.randgen_rot();}
ids = this.ids_nxny[0-x][0-y]; rfl = this.rfl_nxny[0-x][0-y]; rot = this.rot_nxny[0-x][0-y];
}
else
{
if(this.ids_pxny[x] == null ||""+this.ids_pxny[x]=="undefined"){this.ids_pxny[x]=[];}
if(this.rfl_pxny[x] == null ||""+this.rfl_pxny[x]=="undefined"){this.rfl_pxny[x]=[];}
if(this.rot_pxny[x] == null ||""+this.rot_pxny[x]=="undefined"){this.rot_pxny[x]=[];}
if(this.ids_pxny[x][0-y] == null ||""+this.ids_pxny[x][0-y]=="undefined"){this.ids_pxny[x][0-y]=this.randgen_ids();}
if(this.rfl_pxny[x][0-y] == null ||""+this.rfl_pxny[x][0-y]=="undefined"){this.rfl_pxny[x][0-y]=this.randgen_rfl();}
if(this.rot_pxny[x][0-y] == null ||""+this.rot_pxny[x][0-y]=="undefined"){this.rot_pxny[x][0-y]=this.randgen_rot();}
ids = this.ids_pxny[x][0-y]; rfl = this.rfl_pxny[x][0-y]; rot = this.rot_pxny[x][0-y];
}
if(ids != null && ""+ids !="undefined" && ids !=""){this.create_object(ids,x,y);}
x = x +1;
}
}
else
{
x = xmin;
while(x < xmax)
{
if(this.actors[x]== null ||""+this.actors == "undefined"){this.actors[x]=[];}
if(x < 0)
{
if(this.ids_nxpy[0-x] == null ||""+this.ids_nxpy[0-x]=="undefined"){this.ids_nxpy[0-x]=[];}
if(this.rfl_nxpy[0-x] == null ||""+this.rfl_nxpy[0-x]=="undefined"){this.rfl_nxpy[0-x]=[];}
if(this.rot_nxpy[0-x] == null ||""+this.rot_nxpy[0-x]=="undefined"){this.rot_nxpy[0-x]=[];}
if(this.ids_nxpy[0-x][y] == null ||""+this.ids_nxpy[0-x][y]=="undefined"){this.ids_nxpy[0-x][y]=this.randgen_ids();}
if(this.rfl_nxpy[0-x][y] == null ||""+this.rfl_nxpy[0-x][y]=="undefined"){this.rfl_nxpy[0-x][y]=this.randgen_rfl();}
if(this.rot_nxpy[0-x][y] == null ||""+this.rot_nxpy[0-x][y]=="undefined"){this.rot_nxpy[0-x][y]=this.randgen_rot();}
ids = this.ids_nxpy[0-x][y]; rfl = this.rfl_nxpy[0-x][y]; rot = this.rot_nxpy[0-x][y];
}
else
{
if(this.ids_pxpy[x] == null ||""+this.ids_pxpy[x]=="undefined"){this.ids_pxpy[x]=[];}
if(this.rfl_pxpy[x] == null ||""+this.rfl_pxpy[x]=="undefined"){this.rfl_pxpy[x]=[];}
if(this.rot_pxpy[x] == null ||""+this.rot_pxpy[x]=="undefined"){this.rot_pxpy[x]=[];}
if(this.ids_pxpy[x][y] == null ||""+this.ids_pxpy[x][y]=="undefined"){this.ids_pxpy[x][y]=this.randgen_ids();}
if(this.rfl_pxpy[x][y] == null ||""+this.rfl_pxpy[x][y]=="undefined"){this.rfl_pxpy[x][y]=this.randgen_rfl();}
if(this.rot_pxpy[x][y] == null ||""+this.rot_pxpy[x][y]=="undefined"){this.rot_pxpy[x][y]=this.randgen_rot();}
ids = this.ids_pxpy[x][y]; rfl = this.rfl_pxpy[x][y]; rot = this.rot_pxpy[x][y];
}
if(ids != null && ""+ids !="undefined" && ids !="")this.create_object(ids,x,y);
x = x +1;
}
}
}
public function ren_vert(x:Int,ymin:Int,ymax:Int)
{
var y:Int = ymin;
var ids: String; var rfl:Bool; var rot:Int;
if(this.actors[x]== null ||""+this.actors == "undefined"){this.actors[x]=[];}
if(this.actors_posx[x] == null ||""+this.actors_posx[x] == "undefined"){this.actors_posx[x] = [];}
if(this.actors_posy[x] == null ||""+this.actors_posy[x] == "undefined"){this.actors_posy[x] = [];}
if(x < 0)
{
if(this.ids_nxny[0-x] == null ||""+this.ids_nxny[0-x]=="undefined"){this.ids_nxny[0-x]=[];}
if(this.rfl_nxny[0-x] == null ||""+this.rfl_nxny[0-x]=="undefined"){this.rfl_nxny[0-x]=[];}
if(this.rot_nxny[0-x] == null ||""+this.rot_nxny[0-x]=="undefined"){this.rot_nxny[0-x]=[];}
if(this.ids_nxpy[0-x] == null ||""+this.ids_nxpy[0-x]=="undefined"){this.ids_nxpy[0-x]=[];}
if(this.rfl_nxpy[0-x] == null ||""+this.rfl_nxpy[0-x]=="undefined"){this.rfl_nxpy[0-x]=[];}
if(this.rot_nxpy[0-x] == null ||""+this.rot_nxpy[0-x]=="undefined"){this.rot_nxpy[0-x]=[];}
while(y < ymax)
{
if(y < 0)
{
if(this.ids_nxny[0-x][0-y] == null ||""+this.ids_nxny[0-x][0-y]=="undefined"){this.ids_nxny[0-x][0-y]=this.randgen_ids();}
if(this.rfl_nxny[0-x][0-y] == null ||""+this.rfl_nxny[0-x][0-y]=="undefined"){this.rfl_nxny[0-x][0-y]=this.randgen_rfl();}
if(this.rot_nxny[0-x][0-y] == null ||""+this.rot_nxny[0-x][0-y]=="undefined"){this.rot_nxny[0-x][0-y]=this.randgen_rot();}
ids = this.ids_nxny[0-x][0-y]; rfl = this.rfl_nxny[0-x][0-y]; rot = this.rot_nxny[0-x][0-y];
}
else
{
if(this.ids_nxpy[0-x][y] == null ||""+this.ids_nxpy[0-x][y]=="undefined"){this.ids_nxpy[0-x][y]=this.randgen_ids();}
if(this.rfl_nxpy[0-x][y] == null ||""+this.rfl_nxpy[0-x][y]=="undefined"){this.rfl_nxpy[0-x][y]=this.randgen_rfl();}
if(this.rot_nxpy[0-x][y] == null ||""+this.rot_nxpy[0-x][y]=="undefined"){this.rot_nxpy[0-x][y]=this.randgen_rot();}
ids = this.ids_nxpy[0-x][y]; rfl = this.rfl_nxpy[0-x][y]; rot = this.rot_nxpy[0-x][y];
}
if(ids != null && ""+ids !="undefined" && ids !="")this.create_object(ids,x,y);
y = y+1;
}
}
else
{
if(this.ids_pxny[x] == null ||""+this.ids_pxny[x]=="undefined"){this.ids_pxny[x]=[];}
if(this.rfl_pxny[x] == null ||""+this.rfl_pxny[x]=="undefined"){this.rfl_pxny[x]=[];}
if(this.rot_pxny[x] == null ||""+this.rot_pxny[x]=="undefined"){this.rot_pxny[x]=[];}
if(this.ids_pxpy[x] == null ||""+this.ids_pxpy[x]=="undefined"){this.ids_pxpy[x]=[];}
if(this.rfl_pxpy[x] == null ||""+this.rfl_pxpy[x]=="undefined"){this.rfl_pxpy[x]=[];}
if(this.rot_pxpy[x] == null ||""+this.rot_pxpy[x]=="undefined"){this.rot_pxpy[x]=[];}
while(y < ymax)
{
if(y < 0)
{
if(this.ids_pxny[x][0-y] == null ||""+this.ids_pxny[x][0-y]=="undefined"){this.ids_pxny[x][0-y]=this.randgen_ids();}
if(this.rfl_pxny[x][0-y] == null ||""+this.rfl_pxny[x][0-y]=="undefined"){this.rfl_pxny[x][0-y]=this.randgen_rfl();}
if(this.rot_pxny[x][0-y] == null ||""+this.rot_pxny[x][0-y]=="undefined"){this.rot_pxny[x][0-y]=this.randgen_rot();}
ids = this.ids_pxny[x][0-y]; rfl = this.rfl_pxny[x][0-y]; rot = this.rot_pxny[x][0-y];
}
else
{
if(this.ids_pxpy[x][y] == null ||""+this.ids_pxpy[x][y]=="undefined"){this.ids_pxpy[x][y]=this.randgen_ids();}
if(this.rfl_pxpy[x][y] == null ||""+this.rfl_pxpy[x][y]=="undefined"){this.rfl_pxpy[x][y]=this.randgen_rfl();}
if(this.rot_pxpy[x][y] == null ||""+this.rot_pxpy[x][y]=="undefined"){this.rot_pxpy[x][y]=this.randgen_rot();}
ids = this.ids_pxpy[x][y]; rfl = this.rfl_pxpy[x][y]; rot = this.rot_pxpy[x][y];
}
if(ids != null && ""+ids !="undefined" && ids !="")this.create_object(ids,x,y);
y = y+1;
}
}
}
public function set_zoom()
{
var old_zoom = S_gameplay_behav.old_zoom;
var cam_center_x :Float = Engine.cameraX + 0.5 * Engine.screenWidth;
var cam_center_y :Float = Engine.cameraY + 0.5 * Engine.screenHeight;
var delt_x:Float; var delt_y:Float; var new_delt_x:Float; var new_delt_y:Float;
var xmax:Int = S_gameplay_behav.disp_xmax; var xmin:Int = S_gameplay_behav.disp_xmin;
var ymax:Int = S_gameplay_behav.disp_ymax; var ymin:Int = S_gameplay_behav.disp_ymin;
var x:Int = xmin; var y:Int = ymin;
while(x < xmax)
{
if(this.actors[x] == null ||""+this.actors[x] == "undefined"){this.actors[x] = [];}
if(this.actors_posx[x] == null ||""+this.actors_posx[x] == "undefined"){this.actors_posx[x] = [];}
if(this.actors_posy[x] == null ||""+this.actors_posy[x] == "undefined"){this.actors_posy[x] = [];}
y = ymin; while(y < ymax)
{
if(Std.is(this.actors[x][y],Actor))
{
if(this.get_rfl(x,y)){this.actors[x][y].tweenProps.realScaleXY.tween(-1,S_gameplay_behav.zoom,1,S_gameplay_behav.zoom,null,0);}
else{this.actors[x][y].tweenProps.realScaleXY.tween(1,S_gameplay_behav.zoom,1,S_gameplay_behav.zoom,null,0);}
delt_x = this.actors_posx[x][y] + 256*(1 - old_zoom) - cam_center_x;
delt_y = this.actors_posy[x][y] + 256*(1 - old_zoom) - cam_center_y; // differences between upper left corner and camera center.
new_delt_x = delt_x * S_gameplay_behav.zoom / old_zoom; new_delt_y = delt_y * S_gameplay_behav.zoom / old_zoom;
this.actors_posx[x][y] = cam_center_x + new_delt_x - 256*(1 - S_gameplay_behav.zoom);
this.actors_posy[x][y] = cam_center_y + new_delt_y - 256*(1 - S_gameplay_behav.zoom);
this.actors[x][y].setX(this.actors_posx[x][y]); this.actors[x][y].setY(this.actors_posy[x][y]);
}
y = y+1;
}
x = x +1;
}
}
public function shift_nx() // sfint actors to the left.
{
var x:Int = S_gameplay_behav.disp_xmin; var y:Int;
while(x < S_gameplay_behav.disp_xmax)
{
if(this.actors[x] != null &&""+ this.actors[x] != "undefined")
{
y = S_gameplay_behav.disp_ymin; while(y < S_gameplay_behav.disp_ymax)
{
if(Std.is(this.actors[x][y],Actor))
{
this.actors_posx[x][y] -= Engine.sceneWidth/2;
this.actors[x][y].setX(this.actors_posx[x][y]);
}
y = y+1;
}
}
x = x +1;
}
}
public function shift_ny() //shift actors to the right
{
var x:Int = S_gameplay_behav.disp_xmin; var y:Int;
while(x < S_gameplay_behav.disp_xmax)
{
if(this.actors[x] != null &&""+ this.actors[x] != "undefined")
{
y = S_gameplay_behav.disp_ymin; while(y < S_gameplay_behav.disp_ymax)
{
if(Std.is(this.actors[x][y],Actor))
{
this.actors_posy[x][y] -= Engine.sceneHeight/2;
this.actors[x][y].setY(this.actors_posy[x][y]);
}
y = y+1;
}
}
x = x +1;
}
}
public function shift_px()
{
var x:Int = S_gameplay_behav.disp_xmin; var y:Int;
while(x < S_gameplay_behav.disp_xmax)
{
if(this.actors[x] != null &&""+ this.actors[x] != "undefined")
{
y = S_gameplay_behav.disp_ymin; while(y < S_gameplay_behav.disp_ymax)
{
if(Std.is(this.actors[x][y],Actor))
{
this.actors_posx[x][y] += Engine.sceneWidth/2;
this.actors[x][y].setX(this.actors_posx[x][y]);
}
y = y+1;
}
}
x = x +1;
}
}
public function shift_py()
{
var x:Int = S_gameplay_behav.disp_xmin; var y:Int;
while(x < S_gameplay_behav.disp_xmax)
{
if(this.actors[x] != null &&""+ this.actors[x] != "undefined")
{
y = S_gameplay_behav.disp_ymin; while(y < S_gameplay_behav.disp_ymax)
{
if(Std.is(this.actors[x][y],Actor))
{
this.actors_posy[x][y] += Engine.sceneHeight/2;
this.actors[x][y].setY(this.actors_posy[x][y]);
}
y = y+1;
}
}
x = x +1;
}
}
}
No comments:
Post a Comment