Skip to content

Commit e250dd9

Browse files
committed
Update README
1 parent ef91b6a commit e250dd9

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ through entities that contain certain combination of components.
7676

7777
// Create an iterator for all entities that have both a position and a
7878
// vector component
79-
var moveableEntities = eco.createIterator(['position', 'vector']);
79+
var moveable = eco.createIterator(['position', 'vector']);
8080

8181
// In your update loop
82-
moveableEntities.each(function(position, vector, entity) {
82+
moveable.each(function(position, vector, entity) {
8383
/**
8484
* This callback is called for each matching entity
8585
* The components for each entity are injected in the order you
@@ -92,12 +92,3 @@ through entities that contain certain combination of components.
9292
position.x += vector.getVectorX();
9393
position.y += vector.getVectorY();
9494
});
95-
96-
// or you can use a while loop
97-
moveableEntities.reset();
98-
while (var entity = moveableEntities.next()) {
99-
100-
}
101-
102-
// or just get the array of entities and iterate through them as you wish
103-
var entities = moveableEntities.toArray();

0 commit comments

Comments
 (0)