File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff 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();
You can’t perform that action at this time.
0 commit comments