2.1 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 62a115879a6d51422652cbfc | Paso 15 | 0 | step-15 |
--description--
In your role playing game, users will be able to track their stats, buy weapons, and fight monsters. Before you can continue with the interactive JavaScript portion of the game, you need to first create the HTML elements that will display the game information.
Cree cuatro elementos div dentro del elemento #game. Dales los siguientes valores respectivos de id, en orden: stats, controls, monsterStats y text.
--hints--
Debe crear cuatro nuevos elementos div.
assert.equal(document.querySelectorAll('div')?.length, 5);
Debe asignar a uno de los nuevos elementos div un id de stats.
assert.exists(document.querySelector('div#stats'));
Debe asignar a uno de los nuevos elementos div un id de controls.
assert.exists(document.querySelector('div#controls'));
Debe asignar a uno de los nuevos elementos div un id de monsterStats.
assert.exists(document.querySelector('div#monsterStats'));
Debe asignar a uno de los nuevos elementos div un id de text.
assert.exists(document.querySelector('div#text'));
Debe colocar los nuevos elementos div en el orden correcto.
function __t(a, b) {
return document.querySelector(a)?.nextElementSibling?.getAttribute('id') === b;
}
assert(__t('div#stats','controls') && __t('div#controls','monsterStats') && __t('div#monsterStats','text'));
Debe colocar los nuevos elementos div dentro del elemento #game.
assert.equal(document.querySelector('#game')?.children?.length, 4);
--seed--
--seed-contents--
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="./styles.css">
<title>RPG - Dragon Repeller</title>
<script src="./script.js"></script>
</head>
--fcc-editable-region--
<body>
<div id="game">
</div>
</body>
--fcc-editable-region--
</html>
let xp = 0;
let health = 100;
let gold = 50;
let currentWeapon = 0;
let fighting;
let monsterHealth;
let inventory = ["stick"];