1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-29 03:21:54 +00:00
The-Modding-Tree/js/game.js

79 lines
2 KiB
JavaScript
Raw Permalink Normal View History

2021-09-11 17:39:54 +00:00
let gameInfo = {
2022-06-25 23:53:48 +00:00
name: "The ??? Game",
2021-09-11 17:39:54 +00:00
id: "mygame",
author: "nobody",
pointsName: "points",
gameFiles: ["layers.js", "tree.js"],
2020-08-19 02:50:24 +00:00
2021-09-11 17:39:54 +00:00
discordName: "",
discordLink: "",
initialStartPoints: new Decimal (10), // Used for hard resets and new players
offlineLimit: 1, // In hours
2020-10-16 15:39:39 +00:00
}
2021-09-11 17:39:54 +00:00
// Set your version in num and name
let VERSION = {
num: "0.0",
name: "Literally nothing",
2020-08-19 02:50:24 +00:00
}
2021-09-11 17:39:54 +00:00
let changelog = `<h1>Changelog:</h1><br>
<h3>v0.0</h3><br>
- Added things.<br>
- Added stuff.`
2020-12-14 03:23:12 +00:00
2021-09-11 17:39:54 +00:00
let winText = `Congratulations! You have reached the end and beaten this game, but for now...`
2021-09-11 17:39:54 +00:00
// If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here.
// (The ones here are examples, all official functions are already taken care of)
var doNotCallTheseFunctionsEveryTick = ["blowUpEverything"]
2020-10-12 22:28:12 +00:00
2021-09-11 17:39:54 +00:00
function getStartPoints(){
return new Decimal(gameInfo.initialStartPoints)
}
2021-09-11 17:39:54 +00:00
// Determines if it should show points/sec
function canGenPoints(){
return true
2020-08-19 02:50:24 +00:00
}
2021-09-11 17:39:54 +00:00
// Calculate points/sec!
function getPointGen() {
if(!canGenPoints())
return new Decimal(0)
2021-06-17 15:51:40 +00:00
2021-09-11 17:39:54 +00:00
let gain = new Decimal(1)
return gain
}
2021-09-11 17:39:54 +00:00
// You can add non-layer related variables that should to into "player" and be saved here, along with default values
function addedPlayerData() { return {
}}
2021-09-11 17:39:54 +00:00
// Display extra things at the top of the page
var displayThings = [
]
2020-10-11 20:16:36 +00:00
2021-09-11 17:39:54 +00:00
// Determines when the game "ends"
function isEndgame() {
return player.points.gte(new Decimal("e280000000"))
2020-09-09 22:14:05 +00:00
}
2021-09-11 17:39:54 +00:00
// Less important things beyond this point!
2020-09-14 02:41:42 +00:00
2021-09-11 17:39:54 +00:00
// Style for the background, can be a function
var backgroundStyle = {
2020-09-11 02:15:05 +00:00
2020-08-19 02:50:24 +00:00
}
2021-09-11 17:39:54 +00:00
// You can change this if you have things that can be messed up by long tick lengths
function maxTickLength() {
return(3600) // Default is 1 hour which is just arbitrarily large
2020-08-19 02:50:24 +00:00
}
2021-09-11 17:39:54 +00:00
// Use this if you need to undo inflation from an older version. If the version is older than the version that fixed the issue,
// you can cap their current resources with this.
function fixOldSave(oldVersion){
}