Skip to content

Commit 95f9d2a

Browse files
committed
Merge branch 'main' of github.com:TrashPandaCode/dumpster
2 parents 6b5e388 + 6ab0ee0 commit 95f9d2a

6 files changed

Lines changed: 70 additions & 17 deletions

File tree

app/lib/game/core/load-level.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import { useFlowStore } from "~/lib/node-editor/node-store/flow-store";
2-
import { useLoopStore } from "~/lib/node-editor/node-store/loop-store";
3-
import { useNodeStore } from "~/lib/node-editor/node-store/node-store";
4-
import { useDataStore } from "~/lib/zustand/data";
5-
import { useGameStore } from "~/lib/zustand/game";
61
import { LEVELS, type LevelId } from "./levels";
72

83
/**
@@ -12,12 +7,5 @@ import { LEVELS, type LevelId } from "./levels";
127
export const loadLevel = (level: LevelId) => {
138
const curLevel = LEVELS[level];
149

15-
// initialize all stores with level data
16-
useGameStore.getState().init(level);
17-
useFlowStore.getState().init(level);
18-
useNodeStore.getState().init();
19-
useLoopStore.getState().init();
20-
useDataStore.getState().init(level);
21-
2210
curLevel.initialState();
2311
};

app/lib/node-editor/editor-components/HelpMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const HelpMenu = () => {
9797
target="_blank"
9898
to={`/docs/level-guides/${LEVELS[level].slug}`}
9999
>
100-
Find information on this topic here
100+
Find the level guide for this topic here
101101
</NavLink>
102102
<hr className="mx-auto h-1 w-full rounded-sm border-0 bg-slate-700" />
103103
<div className="flex flex-row justify-center gap-2">

app/lib/zustand/init-stores.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { type LevelId } from "../game/core/levels";
2+
import { useFlowStore } from "../node-editor/node-store/flow-store";
3+
import { useLoopStore } from "../node-editor/node-store/loop-store";
4+
import { useNodeStore } from "../node-editor/node-store/node-store";
5+
import { useDataStore } from "./data";
6+
import { useGameStore } from "./game";
7+
8+
/**
9+
* Initializes all stores with the required level data.
10+
* @param level Name of the level to load.
11+
*/
12+
export const initStores = (level: LevelId) => {
13+
// initialize all stores with level data
14+
useGameStore.getState().init(level);
15+
useFlowStore.getState().init(level);
16+
useNodeStore.getState().init();
17+
useLoopStore.getState().init();
18+
useDataStore.getState().init(level);
19+
};

app/routes/Game.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { useFlowStore } from "~/lib/node-editor/node-store/flow-store";
2020
import { useLoopStore } from "~/lib/node-editor/node-store/loop-store";
2121
import { useNodeStore } from "~/lib/node-editor/node-store/node-store";
2222
import { useDataStore } from "~/lib/zustand/data";
23+
import { initStores } from "~/lib/zustand/init-stores";
2324

2425
const Game = ({ params }: Route.ComponentProps) => {
2526
const canvasRef = useRef<HTMLCanvasElement>(null);
@@ -42,6 +43,7 @@ const Game = ({ params }: Route.ComponentProps) => {
4243
}
4344

4445
globalKeyTracker.init();
46+
initStores(level);
4547
initGame(canvasRef.current);
4648
loadLevel(level);
4749

@@ -55,7 +57,7 @@ const Game = ({ params }: Route.ComponentProps) => {
5557
useNodeStore.getState().save();
5658
useLoopStore.getState().save();
5759
useDataStore.getState().save();
58-
}, 1000);
60+
}, 10000);
5961

6062
return () => {
6163
cleanupKaplay();

content/docs/faq.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ This section provides answers to frequently asked questions about the project. I
4141

4242
<Details summary="What if I get stuck on a level?">
4343
Hints are built into each level. For each level a level guide exists in the
44-
documentation. You can also revisit previous levels to reinforce earlier concepts.
44+
documentation. You can also revisit previous levels to reinforce earlier
45+
concepts.
4546
</Details>
4647

4748
<Details summary="Can I share my solutions or learn from others?">
@@ -68,7 +69,7 @@ This section provides answers to frequently asked questions about the project. I
6869
<Details summary="I accidentally skipped the tutorial prompts.">
6970
You can restore all tutorial prompts and guidance messages previously skipped
7071
using the reset tutorial button in the help menu. The help menu can be
71-
accessed in each level using the button displaying a question mark.
72+
accessed in each level using the **?** button.
7273
</Details>
7374

7475
<Details summary="Help, the nodes don't work anymore.">

content/docs/getting-started.mdx

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,47 @@ title: Gettings Started
44

55
# Getting Started
66

7-
This section will help you get started with the project. It will cover the following topics:
7+
Welcome to the learning platform for computer animation and visual programming. Whether you're completely new or just need a refresher, this guide will walk you through the first steps.
8+
9+
## What is This?
10+
11+
This project is an interactive learning environment for computer animation concepts. It features:
12+
13+
- **Levels** that introduce computer animation topics
14+
- **A visual programming interface** allowing the user to control gameobjects
15+
- **Documentation** for every node and computer animation concept
16+
- A global **FAQ page** answering common questions
17+
18+
## Step 1: Start the First Level
19+
20+
Click the big **Play** button on the homepage to jump into the first level. An interactive tutorial will walk you through:
21+
22+
- What each part of the interface does
23+
- How to interact with the node editor
24+
25+
Alternatively, you can pick a level manually by selecting one of the **level cards** on the homepage.
26+
27+
## Step 2: Learn by Doing
28+
29+
Each level introduces a specific concept (e.g., time-transformations, for-loops, inverse kinematics). Levels are designed to be solved using the node-based system — experiment freely!
30+
31+
If you're ever stuck, click the **?** button to view hints or navigate to the level guide outlining detailed explanations and strategies.
32+
33+
## Step 3: Explore the Docs
34+
35+
The [Docs](/docs) page contains everything you need:
36+
37+
- Full documentation for every **node type**
38+
- Reference guides for **animation concepts** like forward/inverse kinematics, hierarchies, and time-transformations
39+
40+
## Tips for Success
41+
42+
- Use the **Import** and **Export** nodes to read and write data from and to game objects
43+
- Don't be afraid to experiment — levels are safe to reset at any time
44+
- Revisit solved levels to reinforce your understanding
45+
46+
Ready to begin? Hit **Play** and start creating!
47+
48+
---
49+
50+
Need help? Visit the [FAQ](/docs/faq) or check the documentation for more details.

0 commit comments

Comments
 (0)