JavaScript Game. Need help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JavaScript Game. Need help

Hello. I am doing school homework and I have to make a rock paper scissors game. I have done the basics like what happens when you choose rock, paper or scissors but I don't know how to make a limit of the score and a restart button. I would appreciate the help. Thanks!

26th Dec 2017, 8:05 PM
Maria
Maria - avatar
1 Answer
0
every time you win you get some score like + 10 and the limit score is 100 you can write like this if(score == 100) { alert("you won"); var sayyes = confirm("do you wanna restart the game?"); if(true){ game(); } } and restart button you making a function game() and putting all code inside it. then if game is finished you write a confirm alert and if its true you starting your function again sry bad english
26th Dec 2017, 8:25 PM
Alex_Joo
Alex_Joo - avatar