path is an array

This commit is contained in:
Gwenhael Le Moine 2011-07-16 11:47:34 +02:00
parent cc34d45d15
commit 104918e0b8

View file

@ -174,7 +174,7 @@ function initialize_a_star( dom_container, level_index ) {
default: break; default: break;
} }
var path = { } + item_coord; var path = [ ] + item_coord;
/* Calculating arrival coordinates */ /* Calculating arrival coordinates */
while ( /* Hairy conditions ahead */ while ( /* Hairy conditions ahead */
/* target cell is within level's boundaries */ /* target cell is within level's boundaries */
@ -201,6 +201,7 @@ function initialize_a_star( dom_container, level_index ) {
} }
update_infos( ); update_infos( );
alert(path);
return path; return path;
} }
@ -221,7 +222,6 @@ function initialize_a_star( dom_container, level_index ) {
// We're inside the board // We're inside the board
if ( click.x == notmovingpos[0] && click.y == notmovingpos[1] ) { if ( click.x == notmovingpos[0] && click.y == notmovingpos[1] ) {
// state.moving = ( state.moving != cell.BALL ) ? cell.BALL : cell.CUBE;
switch_actor( ); switch_actor( );
} else if ( click.x == movingpos[0] ) { } else if ( click.x == movingpos[0] ) {
if ( click.y > movingpos[1] ) { if ( click.y > movingpos[1] ) {