-
Notifications
You must be signed in to change notification settings - Fork 115
Entity
Daan van Yperen edited this page Aug 11, 2015
·
50 revisions
Entities are distinct containers of related components.
Entity myEntity = new EntityBuilder(world)
.with(new Pos(10,10), new Anim("Chicken"))
.tag("boss")
.group("enemies")
.build();
Entity chicken = world.createEntity();
EntityEdit chickenEdit = chicken.edit();
chickenEdit.add(new Pos(10,10));
chickenEdit.add(Anim.class).name = "Chicken;
- Archetype - Fastest, low level, no parameterized components.
- Entity Factory - Fast, clean and convenient. For fixed composition entities. Requires some setup.
EntityEdit chickenEdit = entity.edit();
Flaming flaming = chickenEdit.create(Flaming.class);
flaming.strength = 500;
chickenEdit.remove(Freezing.class);
Entity Transmuters allow for high performance edits.
entity.edit().add(new Flaming(500))
Discouraged for games that may require pooling or packing!
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference