Skip to content
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

add . #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
22 changes: 17 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand All @@ -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');


}


Expand Down
44 changes: 42 additions & 2 deletions scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var scenarios = [
description : "I connect to any wifi network I can use in public.",
power : 1,
}
]
]
},
{
hackerCard : {
Expand All @@ -48,4 +48,44 @@ var scenarios = [
}
]
},
];
{
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,
},
]
},
]
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ h1 strong {
}

.game-over button {
display: none;
display:block;
}

button.next-turn {
Expand Down