Example #1
0
        /// <summary>
        /// Constructors a new sprite.
        /// </summary>        
        public Player(string p_XMLFile, Vector2 initialPosition)
        {
            sprite = new Sprite(GV.ContentManager, p_XMLFile);
            this.state = new IdleState(this);
            this.Direction = GV.RIGHT;
            Sprite.Scale = 1.0f;
            velocity = new Vector2(0,0);
            Position = initialPosition;

            localBounds = new Rectangle(Sprite.BoundingBox.Left, Sprite.BoundingBox.Top, Sprite.BoundingBox.Width, Sprite.BoundingBox.Height);
        }
Example #2
0
 // Constructor
 public HittingState(PlayerState state)
     : this(state.Player)
 {
 }
Example #3
0
 // Constructor
 public MagicAttackState(PlayerState state)
     : this(state.Player)
 {
 }
Example #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public IdleState(PlayerState state)
     : this(state.Player)
 {
 }
Example #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public WalkingState(PlayerState state)
 {
     this.player = state.Player;
       Player.Sprite.PlayAnimation("walking");
       Player.MaxLightRadius = 150;
 }
Example #6
0
 // Constructor
 public LightState(PlayerState state)
     : this(state.Player)
 {
 }
Example #7
0
 /// <summary>
 /// Constructors
 /// </summary>
 /// <param name="state"></param>
 public JumpingState(PlayerState state)
     : this(state.Player)
 {
 }
Example #8
0
 /// <summary>
 /// resets the players health and coordinates from the checkpoint.
 /// </summary>
 public void ResetPlayer()
 {
     this.state = new IdleState(this);
     this.Direction = GV.RIGHT;
     Sprite.Scale = 1.0f;
     velocity = new Vector2(0, 0);
     Position = CheckPoint;
     IsAlive = true;
     health = 600;
 }