HTML and CSS Reference
In-Depth Information
iif ( ! finishedPath ) {
iif ( ! tankStarted ) {
currentNode = startNode ;
tankStarted = true
true ;
nextNode = result [ 0 ];
tankX = currentNode . x * 32 ;
tankY = currentNode . y * 32
}
iif ( tankX == nextNode . x * 32 && tankY == nextNode . y * 32 ) {
//node change
currentNodeIndex ++ ;
iif ( currentNodeIndex == result . length ) {
finishedPath = true
true ;
}
currentNode = nextNode ;
nextNode = result [ currentNodeIndex ]
tankMoving = false
false ;
}
iif ( ! finishedPath ) {
iif ( nextNode . x > currentNode . x ) {
colDelta = 1 ;
} else
else iif ( nextNode . x < currentNode . x ) {
colDelta =- 1
} else
else {
colDelta = 0
}
iif ( nextNode . y > currentNode . y ) {
rowDelta = 1 ;
} else
else iif ( nextNode . y < currentNode . y ) {
rowDelta =- 1
} else
else {
rowDelta = 0
}
angleInRadians = Math . atan2 ( colDelta , rowDelta );
tankMoving = true
true ;
}
tankX += colDelta ;
tankY += rowDelta ;
Search WWH ::




Custom Search