Skip to content

Commit

Permalink
Explaining Cookbook entires a bit more consisely.
Browse files Browse the repository at this point in the history
  • Loading branch information
thygrrr committed Mar 1, 2024
1 parent 79d0eee commit 2d7a723
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions fennecs.tech/cookbook/KillBill.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ outline: [2, 3]
# Paying a Visit to Old Friends

::: info :neofox_floof_mug: MMMH, REAL CODE
This **RUNS**! *Playful premises aside*, this is a functioning showcase of **fenn**ecs features.
This **RUNS**! *Playful premises aside*, this is a functioning showcase of **fenn**ecs principles.

Get comfy, grab a cup of ~~Java~~ ~~CoffeeScript~~ ~~Visual J#~~ whatever, and get your paws dirty playing around in the code! It's good fun!

Expand All @@ -15,11 +15,11 @@ All `.csproj` and `.cs` files are [over here on Github!](https://github.com/thyg
:::

### Premise
To settle an old score, we need to get even with five ~~former friends~~ Entities...
To settle an old score, we need to get even with five ~~former friends~~ Entities... we need to find those that wronged us, and wrong them right back in their face.

We create the Entities and define the [Relation](../docs/Relation.md) (`struct Betrayed`) they have with us, and also ours (`struct Grudge`) with them. We include a plain [Component](../docs/Component.md) (`struct Location`) as useful data to everyone involved.

Next, we query for the Relation, say hello, and ~~unalive~~ interact with the Entities in a [Query.For](../docs/Queries/Query.For.md).
Next, we query for the Relation, say hello, and ~~unalive~~ interact with the Entities in a [Query.For](../docs/Queries/Query.For.md). This removes our `Grudge` for them.

### Implementation
<<< ../../cookbook/KillBill.cs {cs:line-numbers}
Expand Down
5 changes: 3 additions & 2 deletions fennecs.tech/cookbook/OneRing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ outline: [2, 3]

# One Ring to Find Them

:neofox_what: Sorry, work in progress! come back soon.

::: warning :neofox_what: WHAT THE...
Sorry, work in progress! come back soon.
:::

8 changes: 4 additions & 4 deletions fennecs.tech/cookbook/Tsubasa.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ outline: [2, 3]
# Nankatsu High School Team's first Practice

::: info :neofox_floof_mug: MMMH, REAL CODE
This **RUNS**! *Playful premises aside*, this is a functioning showcase of **fenn**ecs features.
This **RUNS**! *Playful premises aside*, this is a functioning showcase of **fenn**ecs principles.

Get comfy, grab a cup of ~~Java~~ ~~CoffeeScript~~ ~~Visual J#~~ whatever, and get your paws dirty playing around in the code! It's good fun!

Expand All @@ -15,11 +15,11 @@ All `.csproj` and `.cs` files are [over here on Github!](https://github.com/thyg
:::

### Premise
Japan's least coordinated soccer team tries to score a goal. They're just kids, all running after the ball at once. They have no ball control whatsoever. Only one of them is kind of a good shot, some kid named "Tsubasa".
Japan's least coordinated soccer team tries to score a goal. They're just kids, all running after the ball at once. Only one of them is kind of a good shot, some kid named "Tsubasa"...

We create a team of 11 Entities with a `Player` and `Name` Component, and a ball entity with a `Ball`. The match has been going on for a long time, so as soon as the only player with a `Talent` Component scores, the match ends with a golden goal.
We create a team of 11 Entities with `Player`, `Name`, `Talent`, and `Position` [Components](../docs/Component.md), and a ball entity with a `Ball`.

In our "game" loop, we get the current position of our ball Entity, and let each player Entity run after it. If they get close enough, they kick the ball to a new position if they have no talent; and finally when a player with the `Talent` component hits the ball, the game ends.
In our "game" loop, we get the current position of our ball Entity, and let each player Entity run after it. If they get close enough, they kick the ball to a new position. As soon as the only player with a truthy `Talent` Component scores, the match ends with a golden goal.

### Implementation
<<< ../../cookbook/Tsubasa.cs {cs:line-numbers}
Expand Down
4 changes: 3 additions & 1 deletion fennecs.tech/cookbook/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ Got an idea? Contributions are welcome! They need to run, they need to provide l
These examples are not best practices, nor good practices. _**They're practice.**_


Use them as you gradually build an understanding and mental model of **fenn**ecs, and good habits will fall into place all on their own. Then, return to that overscoped game project of yours and get cooking!
Use them as you gradually build an understanding and mental model of **fenn**ecs, and good habits will fall into place all on their own.

Later, when you return to that overscoped game project of yours, you can get cooking *for real!*
:::


Expand Down
8 changes: 4 additions & 4 deletions fennecs.tech/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ hero:
tagline: <em>... a tiny, tiny, high-energy ECS!</em>
actions:
- theme: brand
text: Read Docs!
text: Start Here!
link: /docs/index
- theme: brand
text: Get Cooking!
- theme: alt
text: Cookbook
link: /cookbook/
- theme: alt
text: Github
text: GitHub
link: https://github.com/thygrrr/fennecs

features:
Expand Down

0 comments on commit 2d7a723

Please sign in to comment.