コード例 #1
0
ファイル: GameLogic.cs プロジェクト: Jonnyf16/Framework
        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)));
        }
コード例 #2
0
ファイル: GameLogic.cs プロジェクト: danielscherzer/Framework
 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)));
 }