Compare commits

...
Sign in to create a new pull request.

12 commits

Author SHA1 Message Date
b59e74d871 Update examples
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 1m51s
2025-02-25 07:26:45 -06:00
cf82764818 Merge pull request 'Updated docs to include modules for each feature' (#14) from chore/update into main
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m35s
Reviewed-on: #14
2025-01-31 13:56:13 +00:00
f5fbfc2df6 Updated docs to include modules for each feature 2025-01-31 07:54:03 -06:00
4c04207151 Update docs/.vitepress/config.js
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m48s
2025-01-16 20:23:51 +00:00
d47b5ae07f Update postProcess.js
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m54s
2025-01-16 19:59:33 +00:00
476974346d Update postProcess.js
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 41s
2025-01-16 19:49:23 +00:00
5068e4ffd3 Fix sidebar links
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m41s
2025-01-16 19:36:49 +00:00
b96c4157e5 Update .forgejo/workflows/deploy.yml
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m28s
2025-01-16 02:15:23 +00:00
9894c6c810 Update .forgejo/workflows/deploy.yml
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m58s
2025-01-16 02:10:25 +00:00
ba06b79ef1 Update .forgejo/workflows/deploy.yml
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 47s
2025-01-16 00:52:48 +00:00
d6844a8bf5 Fix build issues
All checks were successful
Build and Deploy / build-and-deploy (push) Has been skipped
2024-12-31 07:40:30 -06:00
bac570e78f Merge pull request 'Update to Profectus 0.7' (#13) from feat/boards into main
All checks were successful
Build and Deploy / build-and-deploy (push) Has been skipped
Reviewed-on: #13
2024-12-31 13:27:27 +00:00
8 changed files with 38 additions and 21 deletions

View file

@ -5,8 +5,10 @@ on:
- 'main' - 'main'
jobs: jobs:
build-and-deploy: build-and-deploy:
if: github.repository == 'profectus-engine/profectus-docs' if: github.repository == 'profectus/profectus-docs'
runs-on: docker runs-on: docker
container:
image: node:21-bullseye
steps: steps:
- name: Setup RSync - name: Setup RSync
run: | run: |
@ -27,5 +29,5 @@ jobs:
- name: Deploy 🚀 - name: Deploy 🚀
uses: https://github.com/JamesIves/github-pages-deploy-action@v4.2.5 uses: https://github.com/JamesIves/github-pages-deploy-action@v4.2.5
with: with:
branch: pages # The branch the action should deploy to. branch: gh-pages # The branch the action should deploy to.
folder: docs/.vitepress/dist # The folder the action should deploy. folder: docs/.vitepress/dist # The folder the action should deploy.

View file

@ -28,6 +28,7 @@ module.exports = {
{ text: "API", link: "/api", activeMatch: "^/api/" }, { text: "API", link: "/api", activeMatch: "^/api/" },
{ text: "Forums", link: "https://forums.moddingtree.com" } { text: "Forums", link: "https://forums.moddingtree.com" }
], ],
outline: [2, 3],
socialLinks: [ socialLinks: [
{ icon: "discord", link: "https://discord.gg/yJ4fjnjU54" }, { icon: "discord", link: "https://discord.gg/yJ4fjnjU54" },
{ icon: { svg: '<svg id="erAGSmQsg5F1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 334.73599 164" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><g transform="translate(-1.000199-.435301)"><path d="M271.24983,105.65061q-.36,4.08-.31,8.47.05,4.56-4.49,8.19-9.11,7.28-17.84-.35c-5.3-4.65-3.99-10.34-4.42-16.25-11.33-3.3-21.65-12.470005-22.8-24.590005q-.53-5.59-.95-11.21-.04-.52-.53-.64c-4.87-1.23-7.99-2.08-10.29-6.94-3.9-8.23.79-15.35,8.92-18.12.175893-.059771.287747-.229624.27-.41-.74-8.02-1.4-15.08,1.56-22.79c3.11-8.09,9.57-14.26,17.53-17.62q4.11-1.73,10.44-2.07q8.68-.46,17.4-.26q16.85.37,26.28,13.59c6.43,9.02,5.96,18.48,5.03,29.16q-.05.51.45.64c13.7,3.61,12.56,22.82-1.42,24.78-.330958.046125-.58496.316783-.61.65-.38,5.39-.17,11.34-2.1,16.46q-5.7,15.160005-22.12,19.310005Z" fill="#6b438b"/><path d="M142.39,41.700605l-31,11.57c-.187231.072269-.39801.046259-.563762-.069568s-.265293-.306667-.266238-.510432l.01-19.31q0-.55.51-.74q23.03-8.68,46.02-17.25c2.57-.96,4.78-.76,7.42-.75.129956,0,.254589.051625.346482.143518s.143518.216526.143518.346482v132.320005c.000017.211265-.084586.413735-.23491.56218s-.353842.230494-.56509.22782l-19.99-.01q-1.17,0-1.17-1.16v-104.910005c.000142-.1604-.078229-.310715-.209821-.40243s-.299742-.113219-.450179-.05757Z" fill="#eceff4"/><path d="M59.21,74.480605h33.95c.222782,0,.436439.0885.59397.24603s.24603.371188.24603.59397l-.01,18.96c0,.222782-.0885.436439-.24603.59397s-.371188.24603-.59397.24603l-33.88.03c-.222782,0-.436439.0885-.59397.24603s-.24603.371188-.24603.59397l-.08,38.580005c0,.222782-.0885.436439-.24603.59397s-.371188.24603-.59397.24603l-20.11-.01c-.222782,0-.436439-.0885-.59397-.24603s-.24603-.371188-.24603-.59397l-.01-38.580005c0-.222782-.0885-.436439-.24603-.59397s-.371188-.24603-.59397-.24603h-33.87c-.222782,0-.436439-.0885-.59397-.24603s-.24603-.371188-.24603-.59397l.02-19.02c0-.222782.0885-.436439.24603-.59397s.371188-.24603.59397-.24603l33.86.02c.222782,0,.436439-.0885.59397-.24603s.24603-.371188.24603-.59397v-35.79c0-.222782.0885-.436439.24603-.59397s.371188-.24603.59397-.24603l20.13-.02c.222782,0,.436439.0885.59397.24603s.24603.371188.24603.59397v35.83c0,.222782.0885.436439.24603.59397s.371188.24603.59397.24603Z" fill="#eceff4"/><path d="M244.18983,105.71061c.43,5.91-.88,11.6,4.42,16.25q8.73,7.63,17.84.35q4.54-3.63,4.49-8.19-.05-4.39.31-8.47q24.6,4,42.34,20.72l-.18,37.49-110.93.01-.09-37.61q17.53-16.43,41.8-20.55Z" fill="#533566"/><path d="M202.38983,126.26061l.09,37.61-21.38-.49c-.35821-.009824-.690529-.18897-.89563-.482816s-.258668-.667556-.14437-1.007184q7.21-21.29,22.33-35.63Z" fill="#6b438b"/><path d="M313.58983,126.37061q12.71,12.03,19.9,29.52q1.79,4.36,2.23,6.86.11.61-.51.62l-21.8.49.18-37.49Z" fill="#6b438b"/></g></svg>' }, link: "https://code.incremental.social/profectus/Profectus" } { icon: { svg: '<svg id="erAGSmQsg5F1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 334.73599 164" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><g transform="translate(-1.000199-.435301)"><path d="M271.24983,105.65061q-.36,4.08-.31,8.47.05,4.56-4.49,8.19-9.11,7.28-17.84-.35c-5.3-4.65-3.99-10.34-4.42-16.25-11.33-3.3-21.65-12.470005-22.8-24.590005q-.53-5.59-.95-11.21-.04-.52-.53-.64c-4.87-1.23-7.99-2.08-10.29-6.94-3.9-8.23.79-15.35,8.92-18.12.175893-.059771.287747-.229624.27-.41-.74-8.02-1.4-15.08,1.56-22.79c3.11-8.09,9.57-14.26,17.53-17.62q4.11-1.73,10.44-2.07q8.68-.46,17.4-.26q16.85.37,26.28,13.59c6.43,9.02,5.96,18.48,5.03,29.16q-.05.51.45.64c13.7,3.61,12.56,22.82-1.42,24.78-.330958.046125-.58496.316783-.61.65-.38,5.39-.17,11.34-2.1,16.46q-5.7,15.160005-22.12,19.310005Z" fill="#6b438b"/><path d="M142.39,41.700605l-31,11.57c-.187231.072269-.39801.046259-.563762-.069568s-.265293-.306667-.266238-.510432l.01-19.31q0-.55.51-.74q23.03-8.68,46.02-17.25c2.57-.96,4.78-.76,7.42-.75.129956,0,.254589.051625.346482.143518s.143518.216526.143518.346482v132.320005c.000017.211265-.084586.413735-.23491.56218s-.353842.230494-.56509.22782l-19.99-.01q-1.17,0-1.17-1.16v-104.910005c.000142-.1604-.078229-.310715-.209821-.40243s-.299742-.113219-.450179-.05757Z" fill="#eceff4"/><path d="M59.21,74.480605h33.95c.222782,0,.436439.0885.59397.24603s.24603.371188.24603.59397l-.01,18.96c0,.222782-.0885.436439-.24603.59397s-.371188.24603-.59397.24603l-33.88.03c-.222782,0-.436439.0885-.59397.24603s-.24603.371188-.24603.59397l-.08,38.580005c0,.222782-.0885.436439-.24603.59397s-.371188.24603-.59397.24603l-20.11-.01c-.222782,0-.436439-.0885-.59397-.24603s-.24603-.371188-.24603-.59397l-.01-38.580005c0-.222782-.0885-.436439-.24603-.59397s-.371188-.24603-.59397-.24603h-33.87c-.222782,0-.436439-.0885-.59397-.24603s-.24603-.371188-.24603-.59397l.02-19.02c0-.222782.0885-.436439.24603-.59397s.371188-.24603.59397-.24603l33.86.02c.222782,0,.436439-.0885.59397-.24603s.24603-.371188.24603-.59397v-35.79c0-.222782.0885-.436439.24603-.59397s.371188-.24603.59397-.24603l20.13-.02c.222782,0,.436439.0885.59397.24603s.24603.371188.24603.59397v35.83c0,.222782.0885.436439.24603.59397s.371188.24603.59397.24603Z" fill="#eceff4"/><path d="M244.18983,105.71061c.43,5.91-.88,11.6,4.42,16.25q8.73,7.63,17.84.35q4.54-3.63,4.49-8.19-.05-4.39.31-8.47q24.6,4,42.34,20.72l-.18,37.49-110.93.01-.09-37.61q17.53-16.43,41.8-20.55Z" fill="#533566"/><path d="M202.38983,126.26061l.09,37.61-21.38-.49c-.35821-.009824-.690529-.18897-.89563-.482816s-.258668-.667556-.14437-1.007184q7.21-21.29,22.33-35.63Z" fill="#6b438b"/><path d="M313.58983,126.37061q12.71,12.03,19.9,29.52q1.79,4.36,2.23,6.86.11.61-.51.62l-21.8.49.18-37.49Z" fill="#6b438b"/></g></svg>' }, link: "https://code.incremental.social/profectus/Profectus" }

View file

@ -1,6 +1,6 @@
# Boards # Boards
The Board component allows you to make a pannable and zoomable "board" of components, called nodes. Instead of laying things out using the DOM, everything inside a board should be absolutely positioned. There are various utilities included in [board.tsx](/api/game/boards/board) to assist with implementing common behaviors with boards. Also, most of these code snippets are modified from [the demo project](https://code.incremental.social/profectus/Profectus-Demo/src/branch/main/src/data/layers/board.tsx), which may make a useful reference while implementing your own boards. The Board component allows you to make a pannable and zoomable "board" of components, called nodes. Instead of laying things out using the DOM, everything inside a board should be absolutely positioned. There are various utilities included in [board.tsx](/api/game/boards/board/) to assist with implementing common behaviors with boards. Also, most of these code snippets are modified from [the demo project](https://code.incremental.social/profectus/Profectus-Demo/src/branch/main/src/data/layers/board.tsx), which may make a useful reference while implementing your own boards.
To get started with a board, with a node that's just an upgrade locked to a specific location, it would look like this: To get started with a board, with a node that's just an upgrade locked to a specific location, it would look like this:

View file

@ -2,10 +2,16 @@
## Demo <Badge type="tip" text="Profectus 0.7" /> ## Demo <Badge type="tip" text="Profectus 0.7" />
[View Source](https://code.incremental.social/profectus/TMT-Demo) | [View Project](https://profectus.pages.incremental.social//TMT-Demo/) [View Source](https://code.incremental.social/profectus/TMT-Demo) | [View Project](https://profectus.pages.incremental.social/TMT-Demo/)
A project loosely based off the Demo project for TMT. Uses most of the different features of Profectus, but doesn't have any real gameplay. A project loosely based off the Demo project for TMT. Uses most of the different features of Profectus, but doesn't have any real gameplay.
## The Incremental Tree <Badge type="tip" text="Profectus 0.7" />
[View Source](https://code.incremental.social/maemoon/profectus-jam) | [View Project](https://maemoonowo.itch.io/incremental-tree)
A prestige tree-style incremental game featuring multiple incremental games within, made for the [Profectus Creation Jam 2025](https://itch.io/jam/profectus-creation-jam-2025).
## Planar Pioneers <Badge type="warning" text="Profectus 0.6" /> ## Planar Pioneers <Badge type="warning" text="Profectus 0.6" />
[View Source](https://github.com/thepaperpilot/planar-pioneers/) | [View Project](https://galaxy.click/play/64) [View Source](https://github.com/thepaperpilot/planar-pioneers/) | [View Project](https://galaxy.click/play/64)
@ -23,15 +29,3 @@ A "hopeless startup simulator", made for the [Profectus Creation Jam](https://it
[View Source](https://github.com/thepaperpilot/kronos/) [View Source](https://github.com/thepaperpilot/kronos/)
This is a project that's still under development but is a good resource for things like implementing custom features. This is a project that's still under development but is a good resource for things like implementing custom features.
## Advent Incremental <Badge type="danger" text="Profectus 0.5" />
[View Source](https://github.com/thepaperpilot/advent-Incremental/) | [View Project](https://www.thepaperpilot.org/advent/)
An incremental game with 25 different layers of content. A good example of what a large project looks like. There's also a partial port to 0.6 available [here](https://github.com/thepaperpilot/advent-Incremental/tree/next).
## Primordia <Badge type="danger" text="Profectus 0.5" />
[View Source](https://github.com/Jacorb90/Primordial-Tree) | [View Project](https://jacorb90.me/Primordial-Tree/)
A "The Prestige Tree" style incremental game, developed by the original creator of TPT.

View file

@ -6,8 +6,8 @@ For example, a cost function like `Decimal.pow(amount, 1.05).times(100)` can be
```ts ```ts
const myRepeatable = createRepeatable(() => ({ const myRepeatable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({ requirements: createCostRequirement((): CostRequirementOptions => ({
resource: points, resource: noPersist(points),
cost: Formula.variable(myRepeatable.amount).pow_base(1.05).times(100) cost: Formula.variable(myRepeatable.amount).pow_base(1.05).times(100)
})), })),
maximize: true maximize: true

View file

@ -63,6 +63,25 @@ watch(
This code watches for whether the node exists and the `boundingRect` exists, which are required to display the effect. You can additionally watch any other values that would have an impact on the particle effect, like whether or not it should be emitting. This code watches for whether the node exists and the `boundingRect` exists, which are required to display the effect. You can additionally watch any other values that would have an impact on the particle effect, like whether or not it should be emitting.
For a "one-shot" animation (one that just gets played once when something happens and then deleted), you can simplify the code a bit:
```ts
watch(achievement.earned, earned => {
const rect = layer.nodes.value[achievement.id]?.rect;
const boundingRect = particles.boundingRect.value;
if (earned && rect != null && boundingRect != null) {
particles.addEmitter(particleEffect).then(emitter => {
emitter.updateOwnerPos(
rect.x + rect.width / 2 - boundingRect.x,
rect.y + rect.height / 2 - boundingRect.y
);
emitter.resetPositionTracking();
emitter.playOnceAndDestroy();
});
}
});
```
## Support Hot Reloading ## Support Hot Reloading
If you're using hot reloading, you might need to reload the particle effect. Here's an example from Kronos of adding the callback to the particles constructor: If you're using hot reloading, you might need to reload the particle effect. Here's an example from Kronos of adding the callback to the particles constructor:

View file

@ -28,6 +28,7 @@ function sort(a, b) {
// Update sidebar file // Update sidebar file
const sidebarText = fs.readFileSync("./docs/api/typedoc-sidebar.json") const sidebarText = fs.readFileSync("./docs/api/typedoc-sidebar.json")
.toString() .toString()
.replaceAll(/"[^"]*\/docs\/api\//g, '"/api/')
.replaceAll('{"text":"Functions","collapsed":true', '{"text":"Functions","collapsed":false') .replaceAll('{"text":"Functions","collapsed":true', '{"text":"Functions","collapsed":false')
.replaceAll('{"text":"Interfaces","collapsed":true', '{"text":"Interfaces","collapsed":false') .replaceAll('{"text":"Interfaces","collapsed":true', '{"text":"Interfaces","collapsed":false')
.replaceAll('{"text":"Type Aliases","collapsed":true', '{"text":"Type Aliases","collapsed":false') .replaceAll('{"text":"Type Aliases","collapsed":true', '{"text":"Type Aliases","collapsed":false')
@ -54,7 +55,7 @@ function sort(a, b) {
} }
currentSidebar = nextSidebar.items; currentSidebar = nextSidebar.items;
}); });
currentSidebar.push({ text: path.basename(file).replace(".md", ""), link: `/..\\docs\\api/${relPath.replace("\\", "/")}/${path.basename(file)}` }); currentSidebar.push({ text: path.basename(file).replace(".md", ""), link: `/api/${relPath.replace("\\", "/")}/${path.basename(file)}` });
currentSidebar.sort(sort); currentSidebar.sort(sort);
const filePath = path.resolve(dir, file); const filePath = path.resolve(dir, file);
const stream = fs.createReadStream(filePath); const stream = fs.createReadStream(filePath);
@ -94,7 +95,7 @@ function sort(a, b) {
const fd = fs.openSync(filePath, "w+"); const fd = fs.openSync(filePath, "w+");
fs.writeSync(fd, frontmatter); fs.writeSync(fd, frontmatter);
if (dir.includes("components")) { if (dir.includes("components")) {
fs.writeSync(fd, `[Profectus](../../../index.md) / ${relPath.replaceAll("\\", "/").replaceAll("/components", "")} / ${path.basename(file).replace(".md", "")}\n\n`) fs.writeSync(fd, `[Profectus](${path.relative(dir, "./docs/api").replaceAll("\\", "/") + "/index.md"}) / ${relPath.replaceAll("\\", "/").replaceAll("/components", "")} / ${path.basename(file).replace(".md", "")}\n\n`)
} }
fs.writeSync(fd, data); fs.writeSync(fd, data);
fs.closeSync(fd); fs.closeSync(fd);

@ -1 +1 @@
Subproject commit 78394b83c4225f09405ec92eb6d291007c1230a7 Subproject commit 2c4d95b73d19132f5dca8f0571827445d0b2d194