Skip to content

Profectus / features/clickables/upgrade

features/clickables/upgrade ​

This feature represents an upgrade the player can purchase.

ts
const upgrade = createUpgrade(() => ({
    requirements: createCostRequirement(() => ({
        cost: 100,
        resource: noPersist(points)
    })),
    display: {
        title: "Do something cool",
        description: "You have to buy me to find out what"
    }
}));

You can then give this upgrade an effect by referring to its bought property, such as by making the next feature visible:

ts
const nextUpgrade = createUpgrade(() => ({
    ...,
    visible: upgrade.bought
}));

Index ​

Interfaces ​

Variables ​

Functions ​