From 0ad5cf2eafd7659cde5aac8eedaadad3a5a04629 Mon Sep 17 00:00:00 2001 From: Raj456999 Date: Mon, 14 Feb 2022 22:54:14 +0530 Subject: [PATCH] add . --- .vscode/settings.json | 3 +++ main.js | 22 +++++++++++++++++----- scenario.js | 44 +++++++++++++++++++++++++++++++++++++++++-- style.css | 2 +- 4 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/main.js b/main.js index f242959..358a9f4 100644 --- a/main.js +++ b/main.js @@ -10,19 +10,20 @@ // Life of the player and the hacker. +alert('Hackers card game'); var playerLife = 5; var hackerLife = 5; // Message to be displayed when the game is over -var hackerWinnerMessage = "Write the message here"; -var playerWinnerMessage = "Write the message here"; +var hackerWinnerMessage = "Hacks over the game"; +var playerWinnerMessage = "You won the games"; // ---------------Game code starts here ---------------// // declare a few handy variables like we've done :p -var playerStartLife = parseInt(playerLife); -var hackerStartLife = parseInt(hackerLife); +var playerStartLife = parseInt(5); +var hackerStartLife = parseInt(5); // we will declare the functions for you and you will complete those updateScores(); @@ -63,6 +64,7 @@ function cardClicked(cardEl) { // Now write a function that shows the power level on the player card function revealPlayerPower(){ + } // Write a function that shows the power level on the hacker card @@ -83,8 +85,18 @@ function gameOver(winner) { // Write a function that starts the game +startButton.addEventListener('click',startGame); +const gameboard=document.getElementById('game-board'); function startGame() { - + + console.log('game intialised'); + startButton.classList.add('hide'); + gameboard.classList.remove('hide'); + + + alert('click on startgame to play'); + + } diff --git a/scenario.js b/scenario.js index f926d60..cda5a17 100644 --- a/scenario.js +++ b/scenario.js @@ -26,7 +26,7 @@ var scenarios = [ description : "I connect to any wifi network I can use in public.", power : 1, } - ] + ] }, { hackerCard : { @@ -48,4 +48,44 @@ var scenarios = [ } ] }, -]; \ No newline at end of file + { + hackerCard : { + description :"I used to hack all of your information whenever you visit unknown websites ", + power : 4, + }, + playerCards : [ + { + description : "I will never visit unknown websites", + power : 5, + }, + { + description : "Sometimes I used to vist unknown websites", + power : 3, + }, + { + description : "I always visit unknown websites", + power : 1, + }, + ] + }, + { + hackerCard : { + description:"I always use some applications to pass bugs into your device. ", + power : 3, + }, + playerCards:[ + { + description:"I will never install unknown applications in my device.", + power :5, + }, + { + description: "I will never check where the source of the application.", + power :1, + }, + { + description :"Sometimes theu used to install in my device with other applications", + power : 2, + }, + ] +}, +] diff --git a/style.css b/style.css index 9ceaaee..0bb94d2 100644 --- a/style.css +++ b/style.css @@ -137,7 +137,7 @@ h1 strong { } .game-over button { - display: none; + display:block; } button.next-turn {