how to create an isometric peg board?
Does anyone know how I would modify this little bit of code to create a true isometric peg board? My logic to just shift the pegs down every other row is flawed. I apparently have to do something with 30 degree angles, but I can't seem to wrap my head around it :confused:
Code:
pegDistance = 50;
pegNum = 1;
for (i = 0; i < 10; i++){
for (j = 0; j < 10; j++){
this.attachMovie("peg","peg"+pegNum, pegNum, {_x:i*pegDistance, _y:j*pegDistance});
if (i%2){
this["peg"+pegNum]._y += pegDistance/2;
}
pegNum++;
}
}