Added page with examples.
This commit is contained in:
parent
cc6aaedc32
commit
ef3035f944
4 changed files with 39 additions and 3 deletions
14
examples.js
Normal file
14
examples.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Adding from other files
|
||||||
|
|
||||||
|
// main.js
|
||||||
|
const variables = require("./variables.js");
|
||||||
|
variables.sleep(1000);
|
||||||
|
|
||||||
|
// variables.js
|
||||||
|
module.exports = { //add any functions or variables you want to export in here
|
||||||
|
sleep
|
||||||
|
}
|
||||||
|
|
||||||
|
function sleep(time) {
|
||||||
|
setTimeout(() => {}, time);
|
||||||
|
}
|
||||||
|
|
@ -1 +1,14 @@
|
||||||
// Program is started from here, runs functions from other files.
|
// Program is started from here, runs functions from other files.
|
||||||
|
const huntingGame = require("./huntinggame.js");
|
||||||
|
const variables = require("./variables.js");
|
||||||
|
|
||||||
|
|
||||||
|
console.clear();
|
||||||
|
console.log("__________________________________________________________________________________________________________________________________");
|
||||||
|
console.log(" _____ _ ____ ");
|
||||||
|
console.log(" / ' / / / / ) /");
|
||||||
|
console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-");
|
||||||
|
console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / ");
|
||||||
|
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___");
|
||||||
|
console.log("Credits: Bethesda Game Studio")
|
||||||
|
variables.sleep(1000);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
// Holds the global variables, functions, and math operations such as the day counter and food eaten..
|
// Holds the global variables, functions, and math operations such as the day counter and food eaten..
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
sleep
|
||||||
|
};
|
||||||
|
|
||||||
var day = 0; // Should we add a definite end? 365 Days?
|
var day = 0; // Should we add a definite end? 365 Days?
|
||||||
|
|
||||||
var ammo = 0; // No cap :)
|
var ammo = 0; // No cap :)
|
||||||
|
|
@ -58,3 +62,8 @@ function scavenge() {
|
||||||
inventory.push(random);
|
inventory.push(random);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sleep(time) {
|
||||||
|
setTimeout(() => {}, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue