nyan
This commit is contained in:
		
							parent
							
								
									93534f2832
								
							
						
					
					
						commit
						7e9fdb3af5
					
				
					 3 changed files with 12 additions and 17 deletions
				
			
		|  | @ -8,6 +8,7 @@ | |||
|     </div> | ||||
|     <p id="command">></p><input type="text" id="userInput" name="inputBox"> | ||||
|     <script src="verbhandler.js"></script> | ||||
|     <script src="index.js"></script> | ||||
|     <script src="inventory.js"></script> | ||||
|     <script src="locations.js"></script> | ||||
|     <script src="index.js"></script> | ||||
| </body> | ||||
							
								
								
									
										9
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								index.js
									
									
									
									
									
								
							|  | @ -1,15 +1,8 @@ | |||
| const userInput = document.getElementById("userInput"); | ||||
| var locations; | ||||
| var currentLocation; | ||||
| let gameOver; | ||||
| 
 | ||||
| async function parseJson() { | ||||
|     const result = await fetch("./locations.json") | ||||
|     locations = await result.json() | ||||
| } | ||||
| 
 | ||||
| async function main() { | ||||
|     await parseJson(); | ||||
| function main() { | ||||
|     currentLocation = Object.keys(locations)[0] | ||||
|     printBold(locations[currentLocation].onEntry) | ||||
| } | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| let locations = | ||||
| { | ||||
|     "Computer Room": { | ||||
|         "objects": { | ||||
|  | @ -6,22 +7,22 @@ | |||
|             }, | ||||
|             "Northern Door": { | ||||
|                 "interactable": true, | ||||
|                 "gotoroom": "hallway" | ||||
|                     "gotoroom": "hallway" | ||||
|             } | ||||
|         }, | ||||
|         "verbs": { | ||||
|             "go north": { | ||||
| 
 | ||||
|             "go north": function(inventory, currentLocation, etc) { | ||||
|               printBold("uwu"); | ||||
|             }, | ||||
|             "use computer": { | ||||
| 
 | ||||
|             "go east": function(inventory, currentLocation, etc) { | ||||
|               printBold("uwuwu"); | ||||
|             } | ||||
|         }, | ||||
|           }, | ||||
|         "onEntry": "You are in a dark room. With only a COMPUTER, and a monitor dimly illuminating the room. Type LOOK to see your surroundings." | ||||
|     }, | ||||
| 
 | ||||
| 
 | ||||
|      | ||||
| 
 | ||||
|     "hallway": { | ||||
|         "objects": { | ||||
|             "Northern Door": { | ||||
|  | @ -32,7 +33,7 @@ | |||
|             }, | ||||
|             "Vase": { | ||||
|                 "interactable": true, | ||||
|                 "contains": { | ||||
|                     "contains": { | ||||
|                     "key": { | ||||
|                         "grabable": true | ||||
|                     } | ||||
		Loading…
	
		Reference in a new issue