Exemplo n.º 1
0
 protected override void OnInitialize()
 {
     random = new Random();
     motionSegment = EyeMotionSegment.FadingIn;
     initialEyePositions = new Dictionary<EyeEnemy, Vector2>();
     desiredEyePositions = new Dictionary<EyeEnemy, Vector2>();
     eyeAngles = new Dictionary<EyeEnemy, Single>();
 } 
Exemplo n.º 2
0
        private void BeginCollapseSegment()
        {
            motionSegment = EyeMotionSegment.Collapsing;

            foreach (var eye in ((EyeFlockActor)Actor).Segments)
            {
                eye.AnimateProperty("Opacity", 1.0f, 0.5f, TimeSpan.FromMilliseconds(100));
                eye.IsInvincible = true;
                initialEyePositions[eye] = new Vector2(eye.Location.X, eye.Location.Y);
                desiredEyePositions[eye] = path[0];
                
                if (!eye.IsClosed)
                    eye.Close();
            }
        }        
Exemplo n.º 3
0
        private void BeginExpandingSegment()
        {
            motionSegment = EyeMotionSegment.Expanding;

            var expandAngle = (Single)Math.PI / 4f;

            foreach (var eye in ((EyeFlockActor)Actor).Segments)
            {
                initialEyePositions[eye] = new Vector2(eye.Location.X, eye.Location.Y);
                desiredEyePositions[eye] = new Vector2(eye.Location.X + ((Single)Math.Cos(expandAngle) * ExpandDistance), eye.Location.Y + ((Single)Math.Sin(expandAngle) * ExpandDistance));
                eyeAngles[eye] = expandAngle;
                expandAngle += (Single)(Math.PI / 2f);
            }
        }
Exemplo n.º 4
0
        private void BeginWaitingSegment()
        {
            motionSegment = EyeMotionSegment.Waiting;

            ((EyeFlockActor)Actor).StartFiring();
            
            foreach (var eye in ((EyeFlockActor)Actor).Segments)
            {
                eye.AnimateProperty("Opacity", 0.5f, 1.0f, TimeSpan.FromMilliseconds(100));
                eye.Open();
            }
        }
Exemplo n.º 5
0
        private void BeginMovingSegment()
        {
            motionSegment = EyeMotionSegment.Moving;

            var pathNumber = random.Next(1, 4);
            path = (Vector2[])ResourceDictionary.GetResource("EyePath" + pathNumber.ToString());

            foreach (var eye in ((EyeFlockActor)Actor).Segments)
            {
                eye.IsInvincible = false;
            }
        }