lose condition
Handle losing condition in JS too

Closes #3
controls