Skip to content

Commit

Permalink
Change docs for 8665121
Browse files Browse the repository at this point in the history
  • Loading branch information
xShadowBlade committed Jul 9, 2024
1 parent 8665121 commit 722e765
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,24 @@ coinGame.init();
coinGame.dataManager.loadData();

// Gain coins
coins.static.gain();
coins.gain();

// Buy (max) upgrades
coins.static.buyUpgrade("upg1Coins");
coins.buyUpgrade("upg1Coins");

// Hotkeys
coinGame.keyManager.addKey([
{
id: "gainCoins",
name: "Gain Coins",
key: "g",
onDownContinuous: () => coins.static.gain(),
onDownContinuous: () => coins.gain(),
},
{
id: "buyUpgrades",
name: "Buy Upgrades",
key: "b",
onDownContinuous: () => coins.static.buyUpgrade("upg1Coins"),
onDownContinuous: () => coins.buyUpgrade("upg1Coins"),
},
]);

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/game/gameClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ myGame.keyManager.addKey([
{
name: "Gain Coins",
key: "g",
onDownContinuous: () => myCurrency.static.gain(),
onDownContinuous: () => myCurrency.gain(),
},
]);
```
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/game/resetLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const reset1 = game.addReset(myCurrency);

reset1.onReset = () => {
// Gain gems on reset
gems.static.gain();
gems.gain();
}

// Call the reset
Expand Down
6 changes: 3 additions & 3 deletions documentation/docs/main/currency.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ To create a currency, do either of the following:
// Another parameter - `upgrades` is optional. See the `Upgrade` class for more information.
const myCurrency = myGame.addCurrency("myCurrency");

// All the methods are in `<GameCurrency>.static`, which contains the same methods as <CurrencyStatic>
myCurrency.static.gain();
// <GameCurrency> extends <CurrencyStatic> so it contains the same methods and properties.
myCurrency.gain();

console.log(myCurrency.static.value); // new Decimal(1)
console.log(myCurrency.value); // new Decimal(1)
```

2. Using without `Game` class
Expand Down
8 changes: 4 additions & 4 deletions documentation/docs/tutorials/coinGame/advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ coinGame.keyManager.addKey([
id: "gainCoins",
name: "Gain Coins",
key: "g",
onDownContinuous: () => coins.static.gain(),
onDownContinuous: () => coins.gain(),
},
{
id: "buyUpgrades",
name: "Buy Upgrades",
key: "b",
onDownContinuous: () => coins.static.buyUpgrade("upg1Coins"),
onDownContinuous: () => coins.buyUpgrade("upg1Coins"),
},
]);

Expand Down Expand Up @@ -71,13 +71,13 @@ coinGame.keyManager.addKey([
id: "gainCoins",
name: "Gain Coins",
key: "g",
onDownContinuous: (): void => void coins.static.gain(),
onDownContinuous: (): void => void coins.gain(),
},
{
id: "buyUpgrades",
name: "Buy Upgrades",
key: "b",
onDownContinuous: (): void => void coins.static.buyUpgrade("upg1Coins"),
onDownContinuous: (): void => void coins.buyUpgrade("upg1Coins"),
},
]);

Expand Down
20 changes: 10 additions & 10 deletions documentation/docs/tutorials/coinGame/code/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ const coins = coinGame.addCurrency("coins", coinUpgrades);
const gems = coinGame.addCurrency("gems");

// Add a boost to the currency
gems.static.boost.setBoost({
gems.boost.setBoost({
id: "boostFromCoins",
value: n => n.plus(coins.static.value.div(10)), // Gain 10% of coins
value: n => n.plus(coins.value.div(10)), // Gain 10% of coins
});

// Add a reset layer to the currency
const prestige = coinGame.addReset(coins);

prestige.onReset = () => {
// Add a requirement to reset. In this case, the player needs at least 1000 coins to reset
if (coins.static.value.lt(1000)) return;
if (coins.value.lt(1000)) return;

// Gain gems based on the amount of coins before reset (set by the boost)
gems.static.gain();
gems.gain();
};

// Call the reset layer
Expand All @@ -68,7 +68,7 @@ prestige.onReset = () => {

// Gain coins button
const gainCoins = () => {
coins.static.gain();
coins.gain();
};
document.getElementById("gainCoins").addEventListener("click", gainCoins);

Expand All @@ -80,7 +80,7 @@ document.getElementById("gainGems").addEventListener("click", gainGems);

// Buy (max) upgrades button
const buyUpgrades = () => {
coins.static.buyUpgrade("upg1Coins");
coins.buyUpgrade("upg1Coins");
};
document.getElementById("buyUpgrades").addEventListener("click", buyUpgrades);

Expand All @@ -90,8 +90,8 @@ const gemsDisplay = document.getElementById("gemsDisplay");

// Add a render event that executes every frame
coinGame.eventManager.setEvent("render", "interval", 0, () => {
coinsDisplay.innerHTML = `Coins: ${coins.static.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.static.value.format()}`;
coinsDisplay.innerHTML = `Coins: ${coins.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.value.format()}`;
});

// Advanced
Expand All @@ -109,13 +109,13 @@ coinGame.keyManager.addKey([
id: "gainCoins",
name: "Gain Coins",
key: "g",
onDownContinuous: () => coins.static.gain(),
onDownContinuous: () => coins.gain(),
},
{
id: "buyUpgrades",
name: "Buy Upgrades",
key: "b",
onDownContinuous: () => coins.static.buyUpgrade("upg1Coins"),
onDownContinuous: () => coins.buyUpgrade("upg1Coins"),
},
]);

Expand Down
20 changes: 10 additions & 10 deletions documentation/docs/tutorials/coinGame/code/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ const coins = coinGame.addCurrency("coins", coinUpgrades);
const gems = coinGame.addCurrency("gems");

// Add a boost to the currency
gems.static.boost.setBoost({
gems.boost.setBoost({
id: "boostFromCoins",
value: n => n.plus(coins.static.value.div(10)), // Gain 10% of coins
value: n => n.plus(coins.value.div(10)), // Gain 10% of coins
});

// Add a reset layer to the currency
const prestige = coinGame.addReset(coins);

prestige.onReset = (): void => {
// Add a requirement to reset. In this case, the player needs at least 1000 coins to reset
if (coins.static.value.lt(1000)) return;
if (coins.value.lt(1000)) return;

// Gain gems based on the amount of coins before reset (set by the boost)
gems.static.gain();
gems.gain();
};

// Call the reset layer
Expand All @@ -81,7 +81,7 @@ prestige.onReset = (): void => {

// Gain coins button
const gainCoins = (): void => {
coins.static.gain();
coins.gain();
};
document.getElementById("gainCoins").addEventListener("click", gainCoins);

Expand All @@ -93,7 +93,7 @@ document.getElementById("gainGems").addEventListener("click", gainGems);

// Buy (max) upgrades button
const buyUpgrades = (): void => {
coins.static.buyUpgrade("upg1Coins");
coins.buyUpgrade("upg1Coins");
};
document.getElementById("buyUpgrades").addEventListener("click", buyUpgrades);

Expand All @@ -103,8 +103,8 @@ const gemsDisplay = document.getElementById("gemsDisplay");

// Add a render event that executes every frame
coinGame.eventManager.setEvent("render", "interval", 0, () => {
coinsDisplay.innerHTML = `Coins: ${coins.static.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.static.value.format()}`;
coinsDisplay.innerHTML = `Coins: ${coins.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.value.format()}`;
});

// Advanced
Expand All @@ -122,13 +122,13 @@ coinGame.keyManager.addKey([
id: "gainCoins",
name: "Gain Coins",
key: "g",
onDownContinuous: (): void => void coins.static.gain(),
onDownContinuous: (): void => void coins.gain(),
},
{
id: "buyUpgrades",
name: "Buy Upgrades",
key: "b",
onDownContinuous: (): void => void coins.static.buyUpgrade("upg1Coins"),
onDownContinuous: (): void => void coins.buyUpgrade("upg1Coins"),
},
]);

Expand Down
16 changes: 8 additions & 8 deletions documentation/docs/tutorials/coinGame/display.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This code sets up the body of the HTML file with a paragraph element to display

// Gain coins button
const gainCoins = () => {
coins.static.gain();
coins.gain();
};
document.getElementById("gainCoins").addEventListener("click", gainCoins);

Expand All @@ -58,7 +58,7 @@ document.getElementById("gainGems").addEventListener("click", gainGems);

// Buy (max) upgrades button
const buyUpgrades = () => {
coins.static.buyUpgrade("upg1Coins");
coins.buyUpgrade("upg1Coins");
};
document.getElementById("buyUpgrades").addEventListener("click", buyUpgrades);

Expand All @@ -68,8 +68,8 @@ const gemsDisplay = document.getElementById("gemsDisplay");

// Add a render event that executes every frame
coinGame.eventManager.setEvent("render", "interval", 0, () => {
coinsDisplay.innerHTML = `Coins: ${coins.static.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.static.value.format()}`;
coinsDisplay.innerHTML = `Coins: ${coins.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.value.format()}`;
});
```
</TabItem>
Expand All @@ -82,7 +82,7 @@ coinGame.eventManager.setEvent("render", "interval", 0, () => {

// Gain coins button
const gainCoins = (): void => {
coins.static.gain();
coins.gain();
};
document.getElementById("gainCoins").addEventListener("click", gainCoins);

Expand All @@ -94,7 +94,7 @@ document.getElementById("gainGems").addEventListener("click", gainGems);

// Buy (max) upgrades button
const buyUpgrades = (): void => {
coins.static.buyUpgrade("upg1Coins");
coins.buyUpgrade("upg1Coins");
};
document.getElementById("buyUpgrades").addEventListener("click", buyUpgrades);

Expand All @@ -104,8 +104,8 @@ const gemsDisplay = document.getElementById("gemsDisplay");

// Add a render event that executes every frame
coinGame.eventManager.setEvent("render", "interval", 0, () => {
coinsDisplay.innerHTML = `Coins: ${coins.static.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.static.value.format()}`;
coinsDisplay.innerHTML = `Coins: ${coins.value.format()}`;
gemsDisplay.innerHTML = `Gems: ${gems.value.format()}`;
});

```
Expand Down
16 changes: 8 additions & 8 deletions documentation/docs/tutorials/coinGame/reset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ After you have set up [currency and upgrades](./currency), you can set up reset
const gems = coinGame.addCurrency("gems");

// Add a boost to the currency
gems.static.boost.setBoost({
gems.boost.setBoost({
id: "boostFromCoins",
value: n => n.plus(coins.static.value.div(10)), // Gain 10% of coins
value: n => n.plus(coins.value.div(10)), // Gain 10% of coins
});

// Add a reset layer to the currency
const prestige = coinGame.addReset(coins);

prestige.onReset = () => {
// Add a requirement to reset. In this case, the player needs at least 1000 coins to reset
if (coins.static.value.lt(1000)) return;
if (coins.value.lt(1000)) return;

// Gain gems based on the amount of coins before reset (set by the boost)
gems.static.gain();
gems.gain();
};

// Call the reset layer
Expand All @@ -49,20 +49,20 @@ prestige.reset();
const gems = coinGame.addCurrency("gems");

// Add a boost to the currency
gems.static.boost.setBoost({
gems.boost.setBoost({
id: "boostFromCoins",
value: n => n.plus(coins.static.value.div(10)), // Gain 10% of coins
value: n => n.plus(coins.value.div(10)), // Gain 10% of coins
});

// Add a reset layer to the currency
const prestige = coinGame.addReset(coins);

prestige.onReset = (): void => {
// Add a requirement to reset. In this case, the player needs at least 1000 coins to reset
if (coins.static.value.lt(1000)) return;
if (coins.value.lt(1000)) return;

// Gain gems based on the amount of coins before reset (set by the boost)
gems.static.gain();
gems.gain();
};

// Call the reset layer
Expand Down
8 changes: 4 additions & 4 deletions documentation/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ coinGame.init();
coinGame.dataManager.loadData();

// Gain coins
coins.static.gain();
coins.gain();

// Buy (max) upgrades
coins.static.buyUpgrade("upg1Coins");
coins.buyUpgrade("upg1Coins");

// Hotkeys
coinGame.keyManager.addKey([
{
id: "gainCoins",
name: "Gain Coins",
key: "g",
onDownContinuous: () => coins.static.gain(),
onDownContinuous: () => coins.gain(),
},
{
id: "buyUpgrades",
name: "Buy Upgrades",
key: "b",
onDownContinuous: () => coins.static.buyUpgrade("upg1Coins"),
onDownContinuous: () => coins.buyUpgrade("upg1Coins"),
},
]);

Expand Down

0 comments on commit 722e765

Please sign in to comment.