public PlayerSpaceShip( Game i_Game, GameScreen i_Screen, string i_GameAsset, ShootsManager i_ShootsManager, bool i_IsFirstPlayer) : base(i_Game, i_Screen, i_GameAsset, i_ShootsManager) { m_NumOFSouls = k_StartingNumOfSouls; DrawOrder = k_DrawOrder; m_IsFirstPlayer = i_IsFirstPlayer; m_Animator = new CompositeAnimator(this); CompositeAnimator lostSoulAnimation = new CompositeAnimator("lostSoul", TimeSpan.FromSeconds(1.6), this, new BlinkAnimator("lostSoulBlink", TimeSpan.FromSeconds(1 / 14), TimeSpan.FromSeconds(2.4))); CompositeAnimator dieAnimation = new CompositeAnimator("dying", TimeSpan.FromSeconds(1.6), this, new RotateAnimator("dyingRotate", TimeSpan.FromSeconds(2.4), 4), new FadeOutAnimator("dyingFade", TimeSpan.FromSeconds(2.4))); m_Animator.Add(dieAnimation); m_Animator.Add(lostSoulAnimation); dieAnimation.Enabled = false; lostSoulAnimation.Enabled = false; m_SoulsSprites = new Soul[3]; m_SoulsSprites[0] = new Soul(i_Game, i_Screen, i_GameAsset); m_SoulsSprites[1] = new Soul(i_Game, i_Screen, i_GameAsset); m_SoulsSprites[2] = new Soul(i_Game, i_Screen, i_GameAsset); foreach (Soul soul in m_SoulsSprites) { Screen.Add(soul); } }
private void addJumpAnimations() { Vector2 jumpDelta = new Vector2(k_TextureSize, 0); m_JumpAnimator = new JumpXAnimator(s_AnimationJumpLength, jumpDelta, TimeSpan.Zero, s_JumpXDirection, this); m_JumpAnimators.Add(m_JumpAnimator); m_JumpAnimators.Add(new CellAnimator(s_AnimationJumpLength, EnemyData.EnemyTextureOffset, 2, TimeSpan.Zero)); m_JumpAnimators.Restart(); }
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(); }
private void initAnimations() { m_AnimatorForHit = new CompositeAnimator(this, "ShipBlink"); m_AnimatorForDestruction = new CompositeAnimator(this, "KillShip"); RotateAnimator rotateAnimator = new RotateAnimator(TimeSpan.FromSeconds(k_RotaionLength), k_RotaionPerSec); BlinkAnimator blinkAnimator = new BlinkAnimator(TimeSpan.FromSeconds(k_BlinkLength), TimeSpan.FromSeconds(k_AnimationBlinkLength)); FadeAnimator fadeAnimator = new FadeAnimator(TimeSpan.FromSeconds(k_FadeLength)); rotateAnimator.Finished += onkillSpaceShip; blinkAnimator.Finished += onFinsihAfterHit; m_AnimatorForHit.Add(blinkAnimator); m_AnimatorForDestruction.Add(fadeAnimator); m_AnimatorForDestruction.Add(rotateAnimator); this.Animations = m_AnimatorForHit; }
public MenuItem(Game i_Game, MenuScreen i_Screen, string i_Description, Color i_InactiveColor, Color i_ActiveColor) : base(i_Game, i_Screen, "") { m_Color = i_InactiveColor; m_Description = i_Description; m_InactiveColor = i_InactiveColor; m_ActiveColor = i_ActiveColor; m_Animator = new CompositeAnimator(this); m_Animator.Add(new Animators.ConcreteAnimators.PulseAnimator(k_Active, TimeSpan.Zero, 1.5f, 2)); }
public EnemyMotherShip(Game i_Game, GameScreen i_Screen, ShootsManager i_ShootsManager) : base(i_Game, i_Screen, @"Sprites/MotherShip_32x120", k_PointsForKill, i_ShootsManager, Color.Red) { m_Animator = new CompositeAnimator(this); CompositeAnimator dieAnimation = new CompositeAnimator("dying", TimeSpan.FromSeconds(1.6), this, new ShrinkAnimator("dyingShrink", TimeSpan.FromSeconds(2.4)), new BlinkAnimator("dyingBlink", TimeSpan.FromSeconds(0.2), TimeSpan.FromSeconds(2.4)), new FadeOutAnimator("dyingFade", TimeSpan.FromSeconds(2.4))); m_Animator.Add(dieAnimation); }
public EnemySmallSpaceShip( Game i_Game, GameScreen i_Screen, ShootsManager i_ShootsManager, string i_AssetName, Color i_Color, int i_PointsForKill, params Rectangle[] i_SourceRectangle) : base(i_Game, i_Screen, @"Sprites/EnemySquares", i_PointsForKill, i_ShootsManager, i_Color) { m_SourceRectangles = new Rectangle[2]; m_SourceRectangles[0] = i_SourceRectangle[0]; m_SourceRectangles[1] = i_SourceRectangle[1]; m_SourceRectangle = m_SourceRectangles[0]; isUsingSourceRectangle = true; m_Animator = new CompositeAnimator(this); CompositeAnimator dieAnimation = new CompositeAnimator("dying", TimeSpan.FromSeconds(1.6), this, new ShrinkAnimator("dyingShrink", TimeSpan.FromSeconds(1.6)), new RotateAnimator("dyingRotate", TimeSpan.FromSeconds(1.6), 6)); m_Animator.Add(dieAnimation); m_RndMaxValue = k_RndMaxValueLevel1; }