Beispiel #1
0
 //Object
 public StandardWalker(PlayerTexturePack playerTexturePack, float strafeAcceleration, float maxStrafeVelocity, float jumpVelocity, float dodgeVelocity, float mass, CollisionReferenceMap <RigidBody> referenceMap, GameTime gameTime, Vector2 drawDimensions, PlayerStandards.PlayerType PlayerType, GameMap gameMap, bool mobile = true) : base(playerTexturePack, CreateRigidBody(playerTexturePack.LoopSheets[0].textures[0], mass, referenceMap, drawDimensions, gameMap), gameTime, drawDimensions, PlayerType, gameMap)
 {
     this.Mobile             = mobile;
     this.strafeAcceleration = strafeAcceleration;
     this.maxStrafeVelocity  = maxStrafeVelocity;
     this.jumpVelocity       = jumpVelocity;
     this.dodgeVelocity      = dodgeVelocity;
     movementFriction        = this.strafeAcceleration;
     dodgeTime = playerTexturePack.EventSheets[(int)EventState.DodgeRoll][0].FrameTime * playerTexturePack.EventSheets[(int)EventState.DodgeRoll][0].spriteSheet.textures.Length;
     lastDodge = -dodgeTime;
 }
Beispiel #2
0
        public StandardAttacker(PlayerTexturePack playerTexturePack, float strafeAcceleration, float maxStrafeVelocity, float jumpVelocity, float dodgeVelocity, AttackSpecification[] attackSpecifications, float mass, CollisionReferenceMap <RigidBody> referenceMap, GameTime gameTime, Vector2 drawDimensions, PlayerStandards.PlayerType PlayerType, GameMap gameMap, bool mobile = true) : base(playerTexturePack, strafeAcceleration, maxStrafeVelocity, jumpVelocity, dodgeVelocity, mass, referenceMap, gameTime, drawDimensions, PlayerType, gameMap, mobile)
        {
            if (attackSpecifications.Length == Enum.GetNames(typeof(AttackEvent)).Length)
            {
                this.attackSpecifications = attackSpecifications;
            }
            else
            {
                throw new Exception("Incorrect lunge speed data.");
            }

            BakeAttackColliders(playerTexturePack);
        }