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))); }
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))); }