コード例 #1
0
ファイル: Player.cs プロジェクト: sogatron/Kismet
        /// <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);
        }
コード例 #2
0
ファイル: HittingState.cs プロジェクト: sogatron/Kismet
 // Constructor
 public HittingState(PlayerState state)
     : this(state.Player)
 {
 }
コード例 #3
0
ファイル: MagicAttackState.cs プロジェクト: sogatron/Kismet
 // Constructor
 public MagicAttackState(PlayerState state)
     : this(state.Player)
 {
 }
コード例 #4
0
ファイル: IdleState.cs プロジェクト: dsawyer/Kismet
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public IdleState(PlayerState state)
     : this(state.Player)
 {
 }
コード例 #5
0
ファイル: WalkingState.cs プロジェクト: sogatron/Kismet
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="state"></param>
 public WalkingState(PlayerState state)
 {
     this.player = state.Player;
       Player.Sprite.PlayAnimation("walking");
       Player.MaxLightRadius = 150;
 }
コード例 #6
0
ファイル: LightState.cs プロジェクト: dsawyer/Kismet
 // Constructor
 public LightState(PlayerState state)
     : this(state.Player)
 {
 }
コード例 #7
0
ファイル: JumpingState.cs プロジェクト: dsawyer/Kismet
 /// <summary>
 /// Constructors
 /// </summary>
 /// <param name="state"></param>
 public JumpingState(PlayerState state)
     : this(state.Player)
 {
 }
コード例 #8
0
ファイル: Player.cs プロジェクト: dsawyer/Kismet
 /// <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;
 }