-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added customized player names #71
base: dev
Are you sure you want to change the base?
Conversation
app.js
Outdated
var r = confirm("Would you like to change the name of players?"); | ||
if (r == true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not how variables should declare.
app.js
Outdated
@@ -80,6 +80,13 @@ function newGame() { | |||
score1.textContent = '0'; | |||
current0.textContent = '0'; | |||
current1.textContent = '0'; | |||
var r = confirm("Would you like to change the name of players?"); | |||
if (r == true) { | |||
var person = prompt("Please enter your name", player0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ' '
here
app.js
Outdated
var r = confirm("Would you like to change the name of players?"); | ||
if (r == true) { | ||
var person = prompt("Please enter your name", player0); | ||
document.getElementById("name-0").innerHTML =person; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ' '
here
app.js
Outdated
if (r == true) { | ||
var person = prompt("Please enter your name", player0); | ||
document.getElementById("name-0").innerHTML =person; | ||
var person2 = prompt("Please enter your name", player1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ' '
here
app.js
Outdated
var person = prompt("Please enter your name", player0); | ||
document.getElementById("name-0").innerHTML =person; | ||
var person2 = prompt("Please enter your name", player1); | ||
document.getElementById("name-1").innerHTML =person2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ' '
here too
index.html
Outdated
if (player0 != null) { | ||
document.getElementById("name-0").innerHTML =player0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not properly indented.
index.html
Outdated
if (player1 != null) { | ||
document.getElementById("name-1").innerHTML =player1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not properly indented too.
Added the functionality by which the players can change their names before starting the game and also after starting a new game.