Skip to content

Commit

Permalink
Add dialog for starting simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinesh Kannan committed Feb 16, 2018
1 parent 0881600 commit 4f41b1f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/maps/main.js.map

Large diffs are not rendered by default.

22 changes: 19 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,25 @@ function battleship() {

app.render(m_ships);

setTimeout(() => {
/*setTimeout(() => {
app.simulate();
}, 10000);
}, 10000);*/
vex.dialog.confirm({
message: 'Ready to view the battle?',
buttons: [
$.extend({}, vex.dialog.buttons.YES, {
className: 'vex-dialog-button-primary',
text: 'Play'
})
],
callback: (doIt) => {
if (doIt) {
setTimeout(() => {
app.simulate();
}, 1000);
}
}
});
// call function to wait a bit before starting simulation
//app.simulate();
},
Expand Down Expand Up @@ -550,7 +566,7 @@ function battleship() {
setTimeout(() => {
//alert("Simulation Done");
vex.dialog.alert("Simulation Completed.");
}, 10000);
}, 1000);
}

},
Expand Down

0 comments on commit 4f41b1f

Please sign in to comment.