Ejemplo n.º 1
0
 void ReleaseDesignerOutlets()
 {
     if (MyGameView != null)
     {
         MyGameView.Dispose();
         MyGameView = null;
     }
 }
 void ReleaseDesignerOutlets()
 {
     if (skView != null)
     {
         skView.Dispose();
         skView = null;
     }
 }
 void ReleaseDesignerOutlets()
 {
     if (RocketFightController != null)
     {
         RocketFightController.Dispose();
         RocketFightController = null;
     }
 }
Ejemplo n.º 4
0
 public override void DidMoveToView(SpriteKit.SKView view)
 {
     base.DidMoveToView(view);
     Player = new AgentNode(this, DefaultAgentRadius, new CGPoint(Frame.GetMidX(), Frame.GetMidY()));
     Player.Agent.Behavior = new GKBehavior();
     AgentSystem.AddComponent(Player.Agent);
     SeekGoal = GKGoal.GetGoalToSeekAgent(TrackingAgent);
 }
Ejemplo n.º 5
0
        public override void DidMoveToView(SpriteKit.SKView view)
        {
            base.DidMoveToView(view);
            var wanderer = new AgentNode(this, DefaultAgentRadius, new CGPoint(Frame.GetMidX(), Frame.GetMidY()))
            {
                Color = SKColor.Cyan
            };

            wanderer.Agent.Behavior = GKBehavior.FromGoal(GKGoal.GetGoalToWander(10), 100f);
            AgentSystem.AddComponent(wanderer.Agent);
        }
        void ReleaseDesignerOutlets()
        {
            if (SceneControl != null) {
                SceneControl.Dispose ();
                SceneControl = null;
            }

            if (SkView != null) {
                SkView.Dispose ();
                SkView = null;
            }
        }
Ejemplo n.º 7
0
        void ReleaseDesignerOutlets()
        {
            if (SceneControl != null)
            {
                SceneControl.Dispose();
                SceneControl = null;
            }

            if (SkView != null)
            {
                SkView.Dispose();
                SkView = null;
            }
        }
Ejemplo n.º 8
0
        public override void DidMoveToView(SpriteKit.SKView view)
        {
            base.DidMoveToView(view);
            Player = new AgentNode(this, DefaultAgentRadius, new CGPoint(Frame.GetMidX(), Frame.GetMidY()));
            Player.Agent.Behavior = new GKBehavior();
            AgentSystem.AddComponent(Player.Agent);
            Player.Agent.MaxSpeed *= 1.2f;

            SeekGoal = GKGoal.GetGoalToSeekAgent(TrackingAgent);

            Friends = new [] {
                AddFriend(new CGPoint(Frame.GetMidX() - 150f, Frame.GetMidY())),
                AddFriend(new CGPoint(Frame.GetMidX() + 150f, Frame.GetMidY()))
            };
            SeparateGoal = GKGoal.GetGoalToSeparate(new [] { Player.Agent }, 100f, (float)(Math.PI * 2));
            var behavior = GKBehavior.FromGoal(SeparateGoal, 100f);

            foreach (var friend in Friends)
            {
                friend.Agent.Behavior = behavior;
            }
        }