public PlayerController( CharacterInfo ci, Vector2 startPosition) : base(startPosition, ci.speed, ci.collisionBox, ColliderType.Samus, ci.scale, ci.animationDataPath, ci.animationTexturePath) { this.Inventory = new Inventory(); this.Health = this.MaxHealth; this.MaxMissileCount = c_defaultMaxMissile; this.MissileCount = this.MaxMissileCount; m_baseCollisionBoxHeight = ci.collisionBox.Height; this.model.setStat("shots", 0); this.model.setStat("damageTaken", 0); this.model.setStat("roomsVisited", 0); this.model.setStat("damageDone", 0); }
/// <summary> /// Factory method to construct non-player character controllers /// See other construct() method for more details /// </summary> public static CharacterController construct(CharacterInfo ci, Vector2 startpos) { return construct(ci, startpos, false); }
/// <summary> /// Factory method to create CharacterControllers /// </summary> /// <param name="ci">Information about character apperance and stats</param> /// <param name="startpos">Where in the Area the character should be placed</param> /// <param name="playerControlled">True if the character should be a PC, false if NPC</param> /// <returns>Constructed CharacterController</returns> public static CharacterController construct(CharacterInfo ci, Vector2 startpos, bool playerControlled) { CharacterController cc; ColliderType type; if (playerControlled) { cc = new PlayerController(ci, startpos); type = ColliderType.Samus; } else { throw new Exception("CharacterController:construct unimplemented code reached"); } return cc; }