コード例 #1
0
ファイル: Behaviour.cs プロジェクト: Raunio/Bearventure
 /// <summary>
 /// Set up patrol behaviour with no fixed points. The subject starts patrolling to its direction and turns back when a collision happens. This method can be called upon at any time to switch from a previously initialized behaviour type.
 /// </summary>
 public void InitFreePatrol()
 {
     behaviourType = Constants.BehaviourType.FreePatrol;
     this.pointA = 0;
     this.pointB = 99999;
     nextPoint = pointA;
 }
コード例 #2
0
ファイル: Behaviour.cs プロジェクト: Raunio/Bearventure
 /// <summary>
 /// Set up passive behaviour. A passive subject stands still until the player reaches its line of sight. This method can be called upon at any time to switch from a previously initialized behaviour type.
 /// </summary>
 public void InitPassive()
 {
     behaviourType = Constants.BehaviourType.Passive;
     startPoint = (int)subject.Position.X;
 }
コード例 #3
0
ファイル: Behaviour.cs プロジェクト: Raunio/Bearventure
        /// <summary>
        /// Set up patrol behaviour with fixed points. The subject continuously patrols from point_A to point_B. Starting direction does not matter, the subject starts heading towards point_A automaticly. This method can be called upon at any time to switch from a previously initialized behaviour type.
        /// </summary>
        /// <param name="point_A">First patrolling point in the X-axis. Give it a value of 0 to assing the subjects starting position to point_A</param>
        /// <param name="point_B">Second patrolling point in the X-axis</param>
        public void InitFixedPatrol(int point_A, int point_B)
        {
            behaviourType = Constants.BehaviourType.FixedPatrol;
            this.pointA = point_A;
            this.pointB = point_B;

            nextPoint = NearestPoint;
        }