so i am making a game and it has so many errors i don’t know how to fix
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>test</p>
<script>
var dead = false
var pickup = "Null"
var direction = "null"
if (direction = "null"){
document.write("go to a1 or b1")
}
var direction = prompt("go to a1 or b1")
if (direction = "a1"){
document.write(" you found a sword pick it up? ")
}
var pickup = prompt("pick up the sword?")
if (pickup = "yes"){
document.write("You ran into a goblin")
alert(" you ran into a goblin you killed it with the sword")
var dead = false
}
if (pickup = "no" ){
var dead = true
}
if (dead = true){
alert("you died")
}
</script>
</body>
</html>