Example #1
0
 public Entity BuildEntity(Entity entity, EntityWorld entityWorld, params object[] args)
 {
     PhysicsBody body = entity.AddComponentFromPool<SPShared.ECS.Components.PhysicsBody>();
     body.Body.Shape = shipShape;
     PhysicsSystem physicsSystem = entityWorld.SystemManager.GetSystem<PhysicsSystem>();
     physicsSystem.AddBody(body);
     physicsSystem.AddConstraint(new Constraint2D(body.Body));
     return entity;
 }
 public Entity BuildEntity(Entity e, EntityWorld world, params object[] args)
 {
     e.Group = "EFFECTS";
     e.AddComponentFromPool<Transform>();
     e.AddComponent(new SpatialForm());
     e.AddComponent(new Expires());
     e.GetComponent<SpatialForm>().SpatialFormFile = "ShipExplosion";
     e.GetComponent<Expires>().LifeTime = 1000;
     return e;
 }
        public Entity BuildEntity(Entity e, EntityWorld world, params object[] args)
        {
            e.Group = "BULLETS";

            e.AddComponentFromPool<Transform>();
            e.AddComponent(new SpatialForm());
            e.AddComponent(new Velocity());
            e.AddComponent(new Expires());
            e.GetComponent<SpatialForm>().SpatialFormFile = "Missile";
            e.GetComponent<Expires>().LifeTime = 2000;
            return e;
        }
 public Entity BuildEntity(Entity e, EntityWorld world, params object[] args)
 {
     e.Group = "SHIPS";
     e.AddComponentFromPool<Transform>();
     e.AddComponent(new SpatialForm());
     e.AddComponent(new Health());
     e.AddComponent(new Weapon());
     e.AddComponent(new Enemy());
     e.AddComponent(new Velocity());
     e.GetComponent<SpatialForm>().SpatialFormFile = "EnemyShip";
     e.GetComponent<Health>().HP = 10;
     return e;
 }