check if level is over when playing by mouse
This commit is contained in:
parent
0415c35176
commit
d98f692218
1 changed files with 9 additions and 0 deletions
|
@ -251,6 +251,15 @@ function start_loop( state, elt ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( won_or_not( state ) ) {
|
||||||
|
if ( state.level < levels.length - 1 ) {
|
||||||
|
state = load_level( levels, state.level + 1 );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert( "You won!" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
display_level( state, options.dom_place );
|
display_level( state, options.dom_place );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue