Exemplo n.º 1
0
        public Window(Rect positionAndSize)
            : base(_window = new ResourceFramework.UserControls.NPCs.Window(), positionAndSize)
        {
            NPC = new Kraker {
                Position = new Point(0, 0), CollisionBound = _window.Parent as FrameworkElement
            };
            _kraker = NPC as Kraker;

            Canvas npcSurface = _window.FindName("NPCSurface") as Canvas;

            if (npcSurface == null)
            {
                throw new NotImplementedException("No NPCSurface implemented");
            }
            npcSurface.Children.Add(NPC);


            Action walk = new Action(1000, 3000);

            walk.onAction += WalkOnAction;
            _kraker.AI.Actions.Add(walk);

            Action switchWeapon = new Action(3000, 10000);

            switchWeapon.onAction += SwitchWeaponOnAction;
            _kraker.AI.Actions.Add(switchWeapon);

            Action shoot = new Action(1000, 5000);

            shoot.onAction += ShootOnAction;
            _kraker.AI.Actions.Add(shoot);
        }
Exemplo n.º 2
0
        public ChooseSideScreen()
            : base(_menu)
        {
            Canvas npcMe = _menu.FindName("npcME") as Canvas;

            if (npcMe == null)
            {
                throw new NotImplementedException("MEer not implemented");
            }
            ME me = new ME();

            me.SetValue(Canvas.TopProperty, 140.0);
            me.SetValue(Canvas.LeftProperty, 60.0);
            npcMe.Children.Add(me);
            npcMe.MouseLeftButtonUp += ButtonMeMouseLeftButtonUp;
            npcMe.MouseEnter        += ButtonMouseEnter;

            Canvas npcKraker = _menu.FindName("npcKraker") as Canvas;

            if (npcKraker == null)
            {
                throw new NotImplementedException("Kraker not implemented");
            }
            Kraker kraker = new Kraker();

            kraker.SetValue(Canvas.TopProperty, 200.0);
            kraker.SetValue(Canvas.LeftProperty, 100.0);
            npcKraker.Children.Add(kraker);
            npcKraker.MouseLeftButtonUp += ButtonKrakerMouseLeftButtonUp;
            npcKraker.MouseEnter        += ButtonMouseEnter;

            // todo: implement kraker and remove the 3 lines below;
            kraker.Opacity   = 0.5;
            npcKraker.Cursor = Cursors.Wait;
            ToolTipService.SetToolTip(npcKraker, "Kraker is momenteel in de huidige versie niet beschikbaar.");

            _signPost          = _menu.FindName("SignPost") as SignPost;
            _signPost.SignText = "Naar Home";
            (_signPost.FindName("canvasSignpost") as Canvas).MouseLeftButtonDown += SignPost_MouseLeftButtonDown;
        }