示例#1
0
        /*================================== Score_died ==========================*/
        private void Score_died(object sender, ScoreKeep e)
        {
            Console.WriteLine("You Died!");
            if (bulletCreate != null)
            {
                bulletCreate.Stop();
            }

            DispatcherTimer t      = new DispatcherTimer();
            int             tcount = 0;

            t.Interval = TimeSpan.FromMilliseconds(15);
            t.Tick    += delegate
            {
                tcount++;
                if (tcount > 60)
                {
                    t.Stop();
                    return;
                }

                dyingSize = dyingSize + (24 - dyingSize) / 10;
            };
            t.Start();
        }
示例#2
0
        /*============================= Player >> CTOR ===========================*/
        public Player(Map map) : base(map)
        {
            X      = Math.Round(map.Width / 2);
            Y      = map.Height - 50;
            Width  = 40;
            Height = 45;
            uri    = Asset.hero[0];
            Sprite = new Rec(Width, Height, uri);

            myScore         = new ScoreKeep();
            myScore.IsDead += Score_died;
        }