Can I access properties of an Entity such as the coordinates from the World class that adds the Entity?
Any help is appreciated! Thank you!
Can I access properties of an Entity such as the coordinates from the World class that adds the Entity?
Any help is appreciated! Thank you!
// in your World class
var e:Entity = new Entity();
e.x = 100;
e.y = -100;
add(e);
e.graphic = Image.createRect(50, 50, 0xff00ff);
Is that what you were referring to?
you can also try this
//in world class
var e:entity = classFirst(yournameclass);
e.x = 10;
e.y = 20;
You can also do the following:
var entities:Array = new Array(); //will be populated with entities
world.getAll(entities);
world.getClass(Enemy, entities);
world.getLayer(1, entities);
world.getType("enemy", entities);
var bobEntity:Entity = world.getInstance("bob");