trying to save it. Using phpstorm to view my code and get some errors.
He says my function names have "Variable Implicitly Declared"
function towngate10() { updateDisplay(locations[10].description); if (!gate10) { score = score+5; gate10 = true; } playerLocation = 10; displayScore(); document.getElementById("goNorth").disabled=true; document.getElementById("goSouth").disabled=false; document.getElementById("goEast").disabled=true; document.getElementById("goWest").disabled=true; }
Also, I just want to make sure Iβve worked on my prototypes correctly. Just a sample.
Global arrays:
var locations = [10]; locations[0] = new Location(0,"Intersection","This is where you awoke."); locations[1] = new Location(1,"Cornfield","The cornfields expand for miles."); locations[2] = new Location(2,"Lake","A large lake that is formed by a river flowing from the East.", new Item(1,"Fish","An old rotting fish.")); locations[3] = new Location(3,"Outside Cave","Entrance to the dark cave.");
Location Function:
function Location(id, name, description, item) { this.id = id; this.name = name; this.description = description; this.item = item; this.toString = function() { return "Location: " + this.name + " - " + this.description; } }
source share