mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-27 09:58:44 +01:00
check if level is over when playing by mouse
This commit is contained in:
parent
7aa6186c68
commit
84133b8ec4
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