public Settings()
 {
     KnownActors =
         new Actor[]
         {
             new Sheep(),
             new Warrior(),
             new NuclearWarrior(),
             new BossWarrior(),
             new BossSheep()
         };
 }
Beispiel #2
0
        //[Script(IsDebugCode = true)]
        private static void AddInfo(Sprite InfoMenu, double y, Actor v)
        {
            v.CanMakeFootsteps = false;


            var h = new Sprite();

            Action<uint> Draw =
                color =>
                {
                    h.graphics.clear();
                    h.graphics.beginFill(color, 0.5);
                    h.graphics.drawRect(-32, -32, 64, 64);
                    h.graphics.endFill();
                    //h.graphics.lineStyle(1, 0x808080, 0.8);
                    //h.graphics.drawRect(-32, -32, 64, 64);

                    h.graphics.beginFill(color, 0.5);
                    h.graphics.drawRect(48, -32, 180, 64);
                    h.graphics.endFill();
                    //h.graphics.lineStyle(1, 0x808080, 0.8);
                    //h.graphics.drawRect(48, -32, 180, 64);
                };

            Draw(ColorBlueLight);

            h.click +=
                delegate
                {

                    if (0.5.ByChance())
                    {
                        if (v.PlayHelloSound != null)
                            v.PlayHelloSound();
                    }
                    else
                    {
                        if (v.PlayDeathSound != null)
                            v.PlayDeathSound();
                    }
                };

            h.mouseChildren = false;

            //h.filters = new[] { new GlowFilter(0x808080) };
            h.mouseOver += e => Draw(ColorBlue);
            h.mouseOut += e => Draw(ColorBlueLight);

            var t = new TextField
            {
                x = 64,
                text = v.ActorName + "\n" + v.ScoreValue + " points\n" + v.Description,
                autoSize = TextFieldAutoSize.LEFT,

            }.AttachTo(h);

            t.y -= t.height / 2;

            v.AttachTo(h);

            h.AttachTo(InfoMenu).MoveTo(0, y);
        }