
using breakpoints and bugtracking
Hello. I've got a problem here that involves breakpoints and bugtracking.
the update function that's at the end of the code is updating each frame or something like that. now if i put a breakpoint at the end of the code i can only follow one iteration of the loop, not continuously follow it as it repeats.
Code:
package Classes
{
import org.flixel.*;
import flash.utils.getTimer;
import Classes.*;
public class PlayState extends FlxState
{
public var astarts:Arteriole;
public var basiccell:FlxGroup;
public var tick:int = getTimer();
public var playingfield: Array = new Array();
public var basicCellArray:Array = new Array();
public var distanceArray = new Array();
public var closestEight:Array = [[0, 0, 0, 0, 0, 0, 0, 0]]
public var test:Array = new Array();
public var distance:int = 0;
public var clear:Boolean = false;
public var counter:int = 0;
public var drawn:Boolean = false;
var cg:CellGenerator = new CellGenerator;
public var dx:int;
public var dy:int;
public var testArray:Array = new Array();
public var xcord:int = 200;
public var ycord:int = 200;
public var cellsdrawn:Boolean;
public var _timer:Number;
public function PlayState()
{
for (var rax:int = 0; rax < 100; rax++)
{
playingfield[rax] = 0;
}
FlxG.mouse.show();
playingfield[0] = 3;
playingfield[2] = 2;
super.create();
}
override public function update():void
{
if (clear == false)
{
for (var x1:int = 0; x1 < 10; x1++)
{
for (var y1:int = 0; y1 < 10; y1++)
{
for (var x2:int = 0; x2 < 10; x2++)
{
for (var y2:int = 0; y2 < 10; y2++)
{
dx = x1 - x2;
dy = y1 - y2;
distanceArray[loop]= Math.sqrt(dx*dx+dy*dy);
loop = loop + 1;
}
}
}
}
clear == true;
}
if(cellsdrawn == false)
{
for (var loop:int = 0; loop < 100; loop++)
{
add(basicCellArray[loop] = new BaseCell(xcord, ycord, playingfield[loop]));
xcord = xcord + 16 ;
if (xcord == 360)
{
ycord = ycord + 16;
xcord = 200;
}
if (loop == 99)
{
cellsdrawn = true;
}
}
}
tick = getTimer();
if (tick < 3000 && drawn == false)
{
add(astarts = new Arteriole(216, 200));
playingfield = cg.Cellgeneration(playingfield, distanceArray);
ycord = 200;
for (loop = 0; loop < 100; loop++)
{
add(new BaseCell(xcord, ycord, playingfield[loop]));
xcord = 16 + xcord;
if (xcord == 360)
{
ycord = ycord + 16;
xcord = 200;
}
}
}
}
FlxG.log ("a string goes here");
}
}