示例#1
0
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public MiniBoss(ContentManager p_Content, string p_XMLFile, Vector2 p_InitialPosition)
        {
            Sprite = new Sprite(p_Content, p_XMLFile);
            Sprite.Scale = 1.0f;
            State = new EnemyIdleState(this);
            AnimationReversed = true;
            Direction = GV.LEFT;
            Velocity = new Vector2(0, 0);
            PositionInTile(p_InitialPosition);
            IsAlive = true;
            Health = 100;
            IsOnGround = false;

            StateMachine = new StateMachine(this, new EnemyIdleState(this));

            StateMachine.AddState("KismetDataTypes.EnemyIdleState", "collision", "PatrolState");
            StateMachine.AddState("KismetDataTypes.EnemyIdleState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.PatrolState", "collision", "PursueState");
            StateMachine.AddState("KismetDataTypes.PatrolState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.PursueState", "collision", "AttackState");
            StateMachine.AddState("KismetDataTypes.PursueState", "noCollision", "PatrolState");
            StateMachine.AddState("KismetDataTypes.PursueState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.KnockedDownState", "", "TeleportState");
            StateMachine.AddState("KismetDataTypes.TeleportState", "", "EnemyIdleState");

            StateMachine.AddState("KismetDataTypes.AttackState", "", "PatrolState");
            StateMachine.AddState("KismetDataTypes.AttackState", "isHit", "KnockedDownState");
        }
示例#2
0
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public DemonArcher(ContentManager p_Content, string p_XMLFile, Vector2 p_InitialPosition)
        {
            Sprite = new Sprite(p_Content, p_XMLFile);
            Sprite.Scale = 1.0f;
            State = new EnemyIdleState(this);
            Direction = GV.RIGHT;
            Velocity = new Vector2(0, 0);

            Position = p_InitialPosition;
            IsAlive = true;
            Health = 50;

            IsOnGround = false;

            StateMachine = new StateMachine(this, new EnemyIdleState(this));

            StateMachine.AddState("KismetDataTypes.PatrolState", "insight", "AttackState");
            StateMachine.AddState("KismetDataTypes.EnemyIdleState", "collision", "AttackState");
            StateMachine.AddState("KismetDataTypes.EnemyIdleState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.PatrolState", "collision", "AttackState");
            StateMachine.AddState("KismetDataTypes.PatrolState", "isHit", "KnockedDownState");
            StateMachine.AddState("KismetDataTypes.PatrolState", "jump", "AttackState");

            StateMachine.AddState("KismetDataTypes.PursueState", "collision", "AttackState");
            StateMachine.AddState("KismetDataTypes.PursueState", "noCollision", "EnemyIdleState");
            StateMachine.AddState("KismetDataTypes.PursueState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.KnockedDownState", "", "EnemyIdleState");

            StateMachine.AddState("KismetDataTypes.AttackState", "", "EnemyIdleState");
            StateMachine.AddState("KismetDataTypes.AttackState", "isHit", "KnockedDownState");
        }
示例#3
0
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public FireMage(ContentManager p_Content, string p_XMLFile, Vector2 p_InitialPosition)
        {
            Sprite = new Sprite(p_Content, p_XMLFile);
            Sprite.Scale = 1.0f;
            State = new EnemyIdleState(this);
            Direction = GV.LEFT;
            Velocity = new Vector2(0, 0);

            Position = p_InitialPosition;
            IsAlive = true;
            IsOnGround = false;

            StateMachine = new StateMachine(this, new EnemyIdleState(this));

            StateMachine.AddState("KismetDataTypes.EnemyIdleState", "collision", "AttackState");
            StateMachine.AddState("KismetDataTypes.EnemyIdleState", "isHit", "EnemyIdleState");
            StateMachine.AddState("KismetDataTypes.AttackState", "collision", "EnemyIdleState");
            StateMachine.AddState("KismetDataTypes.AttackState", "isHit", "EnemyIdleState");
            StateMachine.AddState("KismetDataTypes.AttackState", "", "EnemyIdleState");
        }
示例#4
0
文件: Goblin.cs 项目: dsawyer/Kismet
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public Goblin(ContentManager p_Content, string p_XMLFile, Vector2 p_InitialPosition)
        {
            Sprite = new Sprite(p_Content, p_XMLFile);
            Sprite.Scale = 1.0f;
            State = new AwakeState(this);
            Direction = GV.LEFT;
            Velocity = new Vector2(0, 0);
            // Position based on tile
            //PositionInTile(p_InitialPosition);
            // Actual pixel position
            Position = p_InitialPosition;
            IsAlive = true;
            Health = 50;
            IsOnGround = false;
            Name = "Goblin";

            StateMachine = new StateMachine(this, new AwakeState(this));

            StateMachine.AddState("KismetDataTypes.AwakeState", "", "PatrolState");

            StateMachine.AddState("KismetDataTypes.PatrolState", "insight", "PursueState");
            StateMachine.AddState("KismetDataTypes.PatrolState", "jump", "EnemyJumpingState");
            StateMachine.AddState("KismetDataTypes.PatrolState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.EnemyJumpingState", "", "PatrolState");
            StateMachine.AddState("KismetDataTypes.EnemyJumpingState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.PursueState", "collision", "AttackState");
            StateMachine.AddState("KismetDataTypes.PursueState", "noCollision", "PatrolState");
            StateMachine.AddState("KismetDataTypes.PursueState", "isHit", "KnockedDownState");

            StateMachine.AddState("KismetDataTypes.KnockedDownState", "", "PursueState");

            StateMachine.AddState("KismetDataTypes.AttackState", "", "PatrolState");
            StateMachine.AddState("KismetDataTypes.AttackState", "isHit", "KnockedDownState");
        }
示例#5
0
 /// <summary>
 /// Constructors a new sprite.
 /// </summary>        
 public ImpFlock(ContentManager p_Content, string p_XMLFile, Vector2 p_InitialPosition)
 {
     Direction = GV.LEFT;
     IsAlive = true;
     returnPosition = p_InitialPosition;
     Position = p_InitialPosition;
     patternList.Add(PlusPattern);
     patternList.Add(ArrowPatternRight);
     patternList.Add(ArrowPatternLeft);
     patternList.Add(AttackPattern1);
     currentPattern = 0;
     time = 0;
     for (int i = 0; i <5; i++)
     {
         Imp newImp = new Imp(GV.ContentManager, "XML Documents/ImpAnimations", p_InitialPosition);
         newImp.FlockPosition = i;
         flockList.Add(newImp);
     }
     State = new FlockPatrolState(this);
     StateMachine = new StateMachine(this, new FlockPatrolState(this));
     StateMachine.AddState("KismetDataTypes.FlockPatrolState", "", "FlockPatrolState");
     StateMachine.AddState("KismetDataTypes.FlockPatrolState", "insight", "FlockAttackState");
     StateMachine.AddState("KismetDataTypes.FlockAttackState", "", "FlockAttackState");
     StateMachine.AddState("KismetDataTypes.FlockAttackState", "insight", "FlockAttackState");
 }