Skip to content

Commit

Permalink
criando das funções
Browse files Browse the repository at this point in the history
  • Loading branch information
jmtannus committed Feb 22, 2024
1 parent 306d221 commit a250e56
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
21 changes: 20 additions & 1 deletion Aprenda JavaScript-básico-criando-um-jogo-de-RPG/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@ let health = 100;
let gold = 50;
let currentWeapon = 0;
let fighting;
let monsterHealth;
let inventory = ["stick"];

const button1 = document.querySelector("#button1");
const button2 = document.querySelector("#button2");
const button3 = document.querySelector("#button3");

const text = document.querySelector("#text");
const xpText = document.querySelector("#xpText");
const healthText = document.querySelector("#healthText");
const goldText = document.querySelector("#goldText");
const monsterStats = document.querySelector("#monsterStats");
const monsterName = document.querySelector("#monsterName");
const monsterHealthText = document.querySelector("#monsterHealth");

function goStore() {
console.log("Going to store.");
}

function goCave() {
console.log("Going to cave.");
}

function fightDragon() {
console.log("Fighting dragon.");
}
33 changes: 28 additions & 5 deletions Aprenda JavaScript-básico-criando-um-jogo-de-RPG/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,33 @@ body {
max-height: 400px;
background-color: #ffffff;
color: #ffffff;

margin-top: 30px;
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
margin: 30px auto 0px;
padding: 10px;
}

#controls,
#stats {
border: 1px solid #0a0a23;
padding: 5px;
color: #0a0a23;
}

#monsterStats {
display: none;
border: 1px solid #0a0a23;
padding: 5px;
color: #ffffff;
background-color: #c70d0d;
}

.stat {
padding-right: 10px;
}

button {
cursor: pointer;
color: #0a0a23;
background-color: #feac32;
background-image: linear-gradient(#fecc4c, #ffac33);
border: 3px solid #feac32;
}

0 comments on commit a250e56

Please sign in to comment.