Skip to content

Commit b88ee0d

Browse files
Revise Introduction
1 parent 2a7fee3 commit b88ee0d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • content/learn/book/ecs/entities-components

‎content/learn/book/ecs/entities-components/_index.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ page_template = "book-section.html"
66
insert_anchor_links = "right"
77
+++
88

9-
As we discussed in the [introduction](../_index.md) to this chapter, **entities** represent objects in your game world, whose data is stored in the form of components.
9+
**Entities** are the fundamental objects of your game world, whizzing around, storing cameras, being controlled by the player or tracking the state of a button.
10+
On its own, the [`Entity`] type is a simple identifer: it has neither behavior nor data.
11+
Components store this data, and define the overlapping categories that the entity belongs to.
12+
13+
Informally, we use the term "entity" to refer to the conceptual entry in our [`World`]: all of the component data with the correct identifier, although it's very rare to use all of the data for a single entity at once.
14+
If you're familiar with Rust, you can reason about the [`World`] as something like a (very fast) [`HashMap`] from [`Entity`] to a collection of components.
15+
16+
[`Entity`]: https://docs.rs/bevy/latest/bevy/ecs/entity/struct.Entity.html
17+
[`HashMap`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html
18+
[`World`]: https://docs.rs/bevy/latest/bevy/ecs/world/struct.World.html
1019

1120
## Spawning and despawning entities
1221

@@ -29,7 +38,6 @@ fn spawning_system(mut commands: Commands){
2938
}
3039
```
3140

32-
[`World`]: https://docs.rs/bevy/latest/bevy/ecs/world/struct.World.html
3341
[`Commands`]: https://docs.rs/bevy/latest/bevy/ecs/system/struct.Commands.html
3442

3543
## Working with components

0 commit comments

Comments
 (0)