Beispiel #1
0
        private void CreateExplosion(float absoluteTime, Box2D frame)
        {
            var container = registry.CreateComponentContainer();
            var compFrame = new Component <Box2D>(new Box2D(frame));
            var compAnim  = new ComponentAnimated(absoluteTime, 1.0f);

            compAnim.PeriodElapsed += (s, t) => Remove(container);
            registry.RegisterComponentTo(container, compFrame);
            registry.RegisterComponentTo(container, compAnim);
            registry.RegisterComponentTo(container, new Component <IDrawable>(renderer.CreateDrawable("explosion", compFrame.Value, compAnim)));
        }
Beispiel #2
0
 private void CreateExplosion(float absoluteTime, Box2D frame)
 {
     var container = registry.CreateComponentContainer();
     var compFrame = new Component<Box2D>(new Box2D(frame));
     var compAnim = new ComponentAnimated(absoluteTime, 1.0f);
     compAnim.OnPeriodElapsed += (s, t) => Remove(container);
     registry.RegisterComponentTo(container, compFrame);
     registry.RegisterComponentTo(container, compAnim);
     registry.RegisterComponentTo(container, new Component<IDrawable>(renderer.CreateDrawable("explosion", compFrame.Value, compAnim)));
 }