import{_ as e,c as a,o as t,N as o}from"./chunks/framework.0799945b.js";const f=JSON.parse('{"title":"Project Entry","description":"","frontmatter":{},"headers":[],"relativePath":"guide/creating-your-project/project-entry.md","lastUpdated":1681132532000}'),s={name:"guide/creating-your-project/project-entry.md"},r=o('

Project Entry

This is a TypeScript file containing the non-static parts of your project, and acts as the entry point for it.

It is stored at /src/data/projEntry.jsx.

This file has 3 things it must export, but beyond that can export anything the creator wants it to. Typically in addition to the required 3, the initial/"main" layer will be exported. Typically utilites belong in common.tsx, which exists next to projEntry.tsx.

Required Exports

getInitialLayers

A function that is given a player save data object currently being loaded, and returns a list of layers that should be active for that player. If a project does not have dynamic layers, this should always return a list of all layers.

hasWon

A computed ref whose value is true whenever the game is over.

For example, in a game where the goal is to have a resource reach 10:

ts
export const hasWon = computed(() => Decimal.gte(resource.value, 10));

fixOldSave

This function will be run whenever a save is loaded that has a different version than the one in project info. It will be given the old version number, and the player save data object currently being loaded.

The purpose of this function is to perform any necessary migrations, such as capping a resource that accidentally inflated in a previous version of the project. By default it will do nothing.

',17),n=[r];function l(i,p,c,d,h,y){return t(),a("div",null,n)}const g=e(s,[["render",l]]);export{f as __pageData,g as default};