hey everyone, kindly walk me through this, the instruction is below;
On a new line, add the string You attack it with your <weapon>. to the text value, replacing <weapon> with the player’s current weapon. Additionally, remember that this line of text starts with a space so it will properly display.
the code is below;
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText = "You attack it with your " + monsters[fighting].name + " .";
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 119
appreciate your reply. How about the instruction " …replacing <weapon> with the player’s current weapon. Additionally, remember that this line of text starts with a space so it will properly display."
I’m the pitch here is explained as a fight of some sort, between monsters in a fantasy land, who is your explanation. weapon is “knife” please, and involved action of pulling a knife.
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText = "You attack it with your " + weapons[currentWeapon].name + ".";
}
Hey Jessi, firstly, how do I use a compound assignment operator? my code Is below;
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText = "You attack it with your " + weapons[currentWeapon].name + ".";
}