Example #1
0
        protected override void InitAnimations()
        {
            base.InitAnimations();
            CellAnimator cellAnimator = this.Animations["CelAnimation"] as CellAnimator;

            cellAnimator.FirstCellIdx = 0;
            cellAnimator.LastCellIdx  = 1;
        }
        private void initAnimations()
        {
            CellAnimator countDownAnimation = new CellAnimator(new TimeSpan(0, 0, 1), 7, TimeSpan.Zero, 4);

            countDownAnimation.IsIncreasingProgression = false;
            this.m_Counter.Animations.Add(countDownAnimation);
            this.m_Counter.Animations.Enabled = true;
        }
Example #3
0
        public void UpdateCellAnimator()
        {
            CellAnimator cellAnimator = Animations["CelAnimation"] as CellAnimator;

            if (cellAnimator != null)
            {
                cellAnimator.CellTime = m_Comander.SecondsBetweenJumps;
            }
        }
Example #4
0
        private void createCellAnimator()
        {
            TimeSpan     cellLength   = TimeSpan.FromSeconds(TimeUntilJump);
            CellAnimator cellAnimator =
                new CellAnimator(cellLength, CurrentCellIndex, m_MaxTextureCells, TimeSpan.Zero);

            this.Animations.Add(cellAnimator);
            TimeUntilJumpChange += Invader_TimeUntilJumpChange;
        }
Example #5
0
        public AlienMatrixEnemy(Rectangle i_SourceRectangle, int i_ScoreWorth, Color i_TintColor, GameScreen i_GameScreen)
            : base(k_AssetName, i_SourceRectangle, i_GameScreen)
        {
            CellAnimation = new CellAnimator(k_IsStartCellAnimationFromEnd, TimeSpan.FromSeconds(k_CellAnimationTimePerCell), k_NumOfCells, TimeSpan.Zero);

            this.Gun            = new Gun(k_MaxShotInMidAir, this);
            this.Score          = i_ScoreWorth;
            this.TintColor      = i_TintColor;
            this.Width          = k_DefaultWidth;
            this.Height         = k_DefaultHeight;
            this.RotationOrigin = new Vector2(Width / 2, Height / 2);
        }
Example #6
0
        private void initAnimations()
        {
            m_CellAnimator = new CellAnimator(this, m_FrameTime, k_NumOfFramesInRow, m_EnemyFrameColIndex, m_EnemyFrameRowIndex, TimeSpan.Zero);
            ShrinkerAnimator shrinkerAnimator = new ShrinkerAnimator(r_AnimationLenght);
            RotatorAnimator  rotatorAnimator  = new RotatorAnimator(k_EnemyRotatePace, r_AnimationLenght);

            m_Animations.AnimationLength = r_AnimationLenght;
            m_Animations.Add(shrinkerAnimator);
            m_Animations.Add(rotatorAnimator);
            m_Animations.Finished += animations_Finished;
            m_Animations.Enabled   = false;
        }
Example #7
0
        private void initAnimations()
        {
            CellAnimator        cellAnimator         = new CellAnimator("CellAnimation", TimeSpan.FromSeconds(k_CellTime), k_NumOfCells, TimeSpan.Zero, this.r_StartIndexInTexture);
            RotateAnimator      rotateAnimation      = new RotateAnimator("Rotate", k_AngularVelocity, TimeSpan.FromSeconds(k_AnimationDuration));
            ChangeScaleAnimator changeScaleAnimation = new ChangeScaleAnimator("ChangeScale", TimeSpan.FromSeconds(k_AnimationDuration), Scales);

            Animations.Add(rotateAnimation);
            Animations.Add(cellAnimator);
            Animations.Add(changeScaleAnimation);
            Animations.Resume();
            Animations["CellAnimation"].Resume();
            changeScaleAnimation.Finished += changeScaleAnimation_Finished;
        }
Example #8
0
        private void initAnimations()
        {
            ShrinkAnimator    shrinker           = new ShrinkAnimator(TimeSpan.FromSeconds(1.2));
            RoataterAnimator  rotate             = new RoataterAnimator(6, TimeSpan.FromSeconds(1.2));
            CompositeAnimator dyingEnemy         = new CompositeAnimator("dyingEnemy", TimeSpan.FromSeconds(1.2), this, shrinker, rotate);
            CellAnimator      enemyCellAnimation = new CellAnimator(this.m_TimeUntilNextStepInSec, 2, TimeSpan.Zero, this.m_StartSqureIndex, true, this.m_Toggeler);

            this.Animations.Add(enemyCellAnimation);
            this.Animations.Add(dyingEnemy);

            this.PositionChanged   += new EventHandler <EventArgs>(this.cellAnimationPosition_Changed);
            dyingEnemy.Finished    += new EventHandler(this.dyingEnemy_Finished);
            this.Animations.Enabled = true;
        }
Example #9
0
    // called from BoardCellController when creating the board
    public void Initialize(BoardBuilder parent, int _iPos, int _jPos)
    {
        boardBuilder = parent;
        iPos         = _iPos;
        jPos         = _jPos;
        state        = BoardCellState.Empty;

        cellAnim = gameObject.GetComponentInChildren <CellAnimator>();
        animator = cellAnim.GetComponent <Animator>();

        cellHighlight = gameObject.GetComponentInChildren <CellHighlight>();

        cellBackground = gameObject.GetComponentInChildren <CellBackground>();
        cellBackground.Init(iPos, jPos);
    }
Example #10
0
        public void InitAnimations()
        {
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(1.5));
            RotateAnimator rotateAnimator = new RotateAnimator(5, RotateAnimator.eDirection.Right, TimeSpan.FromSeconds(1.5));
            CellAnimator   cellAnimator   = new CellAnimator(TimeSpan.FromMilliseconds(500), r_TextureStartIndex, r_TextureEndIndex, TimeSpan.Zero);

            this.Animations.Add(shrinkAnimator);
            this.Animations.Add(rotateAnimator);
            this.Animations.Add(cellAnimator);
            cellAnimator.Resume();
            shrinkAnimator.Pause();
            rotateAnimator.Pause();
            this.Animations.Resume();
            shrinkAnimator.Finished += shrinkAnimator_Finished;
        }
Example #11
0
        private void initAnimations()
        {
            m_AnimationWhenDead      = new CompositeAnimator(this, "AnimationWhenDead");
            m_AnimationChangeTexture = new CompositeAnimator(this, "ChangeTexture");
            CellAnimator   cellAnimator   = new CellAnimator(TimeSpan.FromSeconds(m_TimeToJump), k_NumOfFrames, TimeSpan.FromSeconds(0), r_EnemyType % 2, false);
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(k_AnnimationTime));
            RotateAnimator rotateAnimator = new RotateAnimator(TimeSpan.FromSeconds(k_AnnimationTime), k_SpinPerSec);

            m_AnimationChangeTexture.Add(cellAnimator);
            m_AnimationWhenDead.Add(shrinkAnimator);
            m_AnimationWhenDead.Add(rotateAnimator);
            shrinkAnimator.Finished += killEnemy;
            this.Animations          = m_AnimationChangeTexture;
            this.Animations.Resume();
        }
Example #12
0
        protected override void InitAnimations()
        {
            float          sixRounds      = (MathHelper.TwoPi) * 6;
            CellAnimator   celAnimation   = new CellAnimator(TimeSpan.FromSeconds(k_HalfSec), TimeSpan.Zero);
            RotateAnimator rotateAnimator = new RotateAnimator(sixRounds, TimeSpan.FromSeconds(1.2));
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(1.2));

            rotateAnimator.Finished += onRotatorAnimatorFinished;
            this.Animations.Add(celAnimation);
            this.Animations.Add(rotateAnimator);
            this.Animations.Add(shrinkAnimator);
            (this.Animations["RotateAnimation"] as RotateAnimator).Enabled = false;
            (this.Animations["ShrinkAnimation"] as ShrinkAnimator).Enabled = false;
            this.Animations.Enabled = true;
        }
Example #13
0
        private void initAnimations()
        {
            TimeSpan animationLength = TimeSpan.FromSeconds(0.5);

            CellAnimator celAnimation = new CellAnimator(animationLength, k_NumOfFrames, (int)CellIdx.Y, TimeSpan.Zero);

            float spinsPerSecond = MathHelper.TwoPi * 6;

            animationLength = TimeSpan.FromSeconds(1.2);

            SpinAnimator   spinner  = new SpinAnimator("Spinner", spinsPerSecond, animationLength);
            ShrinkAnimator shrinker = new ShrinkAnimator("Shrinker", animationLength);

            spinner.Finished += new EventHandler(spinner_OnDyingAnimationFinish);

            this.Animations.Add(celAnimation);
            this.Animations.Add(spinner);
            this.Animations.Add(shrinker);

            this.Animations.Enabled             = true;
            this.Animations["Spinner"].Enabled  = false;
            this.Animations["Shrinker"].Enabled = false;
        }
Example #14
0
 private void initEnemy(AlienMatrixEnemy i_Enemy, float i_PositionX, float i_PositionY, CellAnimator i_CellAnimator = null)
 {
     i_Enemy.MaxShotsInMidAir    = MaxShotsInMidAir;
     i_Enemy.CellAnimation       = i_CellAnimator;
     i_Enemy.StartPosition       = new Vector2(i_PositionX, i_PositionY);
     i_Enemy.StartVelocity       = new Vector2(k_AlienEnemyVelocity, 0);
     i_Enemy.VisibleChanged     += enemy_VisibleChanged;
     i_Enemy.GroupRepresentative = this;
 }