- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
private function pathfindingOfHell(begin:Point, to:Point, delPoint:Point):Boolean
{
var aop:Vector.<GameFigure> = new Vector.<GameFigure>();
aop.push(arr[begin.x][begin.y]);
var i:uint = 0;
while (i != count * 2 - 1)
{
for (var x_:int = -1;x_ < 2;x_++)
for (var y_:int = -1;y_ < 2;y_++)
{
if (x_ != 0 && y_ != 0)
{
var tP:Point = new Point(aop[aop.length - 1].x_pos + x_, aop[aop.length - 1].y_pos + y_);
var target:GameFigure = arr[tP.x][tP.y];
if (!target.isFreedom && !searchInArray(aop, target) && delPoint != tP)
{
aop.push(target);
if (target == arr[to.x][to.y])
{
aop = null;
return true;
}
}
}
}
i++;
}
aop = null;
return false;
}
KirAmp 06.12.2011 10:49 # −2
guest 09.12.2011 17:09 # 0
KirAmp 09.12.2011 22:44 # −2
оплата 5к
guest 06.12.2011 19:03 # −6
lucidfoxGovno 06.12.2011 20:39 # +3