HaremManic Wrote:Would it be better if I just showed you things by making the gameplay so you could play and see if you like?
var hero:obj_brawler = fun_make_a(new kya_main(), LordGame.ally_array, LordGame.XMIN, LordGame.YMID, 0);
hero.target_array = LordGame.enemy_array;
hero.player = true;
LordGame.hero = hero;
with (fun_make_a(new kya_main(), LordGame.enemy_array, LordGame.XMID-100+200*Math.random(), LordGame.YMID-60+120*Math.random(), 100)) {
target_array = LordGame.ally_array;
mysprite = LordGraphic.ss_kya_main2;
}
public function fun_make_a(newthing:* , myarray:Array, xx:int = 0, yy:int = 0, zz:int = 0 ):*
newthing.x = xx;
newthing.y = yy;
newthing.z = zz;
myarray.push(newthing);
return newthing;
public function hitbox(array:Array, xx:Number, yy:Number, zz:Number, hb_xsize:int, hb_ysize:uint, hb_zsize:uint,
dmg:uint, force:Number, angle:int, stun:uint, zforce:Number = 0, flincher:int = 0, charge:Boolean = true):Boolean
{
var hitsomething:Boolean = false;
//do math to hitbox coordinates
Main.debug_text = "goddammit";
if (array.length > 0) {
Main.debug_text = "goddammit!";
for (var a:String in array) {
if (array[a].x - array[a].x_size < xx+.5*hb_xsize && xx-.5*hb_xsize < array[a].x + array[a].x_size
&& array[a].y - array[a].y_size < yy+.5*hb_ysize && yy-.5*hb_ysize < array[a].y + array[a].y_size
&& array[a].z < array[a].z_size + hb_zsize && zz < array[a].z + array[a].hb_zsize)
{
hitsomething = true;
Main.debug_text = "goddammit!!";
//damage things
}
}//for a
}//array.length
return hitsomething;
}//hitbox
Users browsing this forum: No registered users