本文整理汇总了C#中Player.Jump方法的典型用法代码示例。如果您正苦于以下问题:C# Player.Jump方法的具体用法?C# Player.Jump怎么用?C# Player.Jump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.Jump方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleInput
public override State HandleInput(Player player, StateInput input)
{
switch (input)
{
case StateInput.LeftKeyPress:
if (Math.Abs(player.velocity.X) >= (player.maxSpeed * 0.75f))
return new Running(-1);
direction = Direction.Left;
player.flip = SpriteEffects.FlipHorizontally;
break;
case StateInput.RightKeyPress:
if (Math.Abs(player.velocity.X) >= (player.maxSpeed * 0.75f))
return new Running(1);
direction = Direction.Right;
player.flip = SpriteEffects.None;
break;
case StateInput.AttackKeyPress:
return new Attacking(this);
case StateInput.AnimEnd:
break;
case StateInput.UpKeyPress:
player.Jump(1);
return new Jumping((int)direction);
default:
break;
}
if (direction == Direction.Null && player.velocity.X == 0)
return new Idle();
return base.HandleInput(player, input, this);
}
示例2: EnterState
public void EnterState(Player player)
{
if (player.GetMoveController().isStunned == false)
{
player.Jump();
player.SetIsGrounded(false);
}
}
示例3: EnterState
public void EnterState(Player player)
{
if (!player.GetMoveController().isStunned && !player.attackController.GetIsAttack())
{
player.Jump();
//player.SetIsGrounded(false);
//player.animator.SetBool("IsJumping", true);
//player.animator.SetBool("IsGrounded", false);
}
}
示例4: Update
public override void Update(Player player, GameTime gameTime)
{
if (immuneTimer == 0)
{
player.Jump(0.4f);
player.velocity.X = 0;
}
immuneTimer += gameTime.ElapsedGameTime.Milliseconds;
blinkTimer += gameTime.ElapsedGameTime.Milliseconds;
if (blinkTimer >= BLINK_CLOCK)
{
blink = !blink;
blinkTimer = 0f;
}
if (immuneTimer >= IMMUNE_CLOCK)
{
player.effectState = null;
}
}
示例5: HandleInput
public override State HandleInput(Player player, StateInput input)
{
switch (input)
{
case StateInput.UpKeyPress:
player.Jump(1);
return new Jumping(0);
case StateInput.AnimEnd:
if (player.velocity.X > 9)
return new Running(0);
else if (player.velocity.X != 0)
return new Walking(0);
else
return new Idle();
case StateInput.AttackKeyPress:
return new Attacking(this);
default:
break;
}
return base.HandleInput(player, input, this);
}
示例6: HandleInput
public override State HandleInput(Player player, StateInput input)
{
switch(input)
{
case StateInput.LeftKeyPress:
return new Walking(-1);
case StateInput.RightKeyPress:
return new Walking(1);
case StateInput.UpKeyPress:
player.Jump(1);
return new Jumping(0);
case StateInput.Hit:
player.TakeHit(1);
break;
case StateInput.AttackKeyPress:
return new Attacking(this);
default:
break;
}
return base.HandleInput(player, input, this);
}
示例7: HandleInput
public override State HandleInput(Player player, StateInput input)
{
switch (input)
{
case StateInput.UpKeyPress:
player.Jump(1);
return new Jumping((int)direction);
case StateInput.AnimEnd:
break;
case StateInput.AttackKeyPress:
return new Attacking(this);
default:
break;
}
if (direction == Direction.Null && player.velocity.X == 0)
{
return new Idle();
}
if (player.velocity.Y > player.gravityAcceleration * 4)
return new Falling(direction);
return base.HandleInput(player, input, this);
}
示例8: Execute
public void Execute(Player player)
{
player.Jump();
}
示例9: Execute
public void Execute(Player p)
{
p.Jump();
}
示例10: HandleInput
public void HandleInput(InputState input, Player player)
{
PlayerIndex playerIndex;
if (!CharacterPhysics.OnLadder(player))
{
if (moveLeft.Evaluate(input, ControllingPlayer, out playerIndex))
{
if (run.Evaluate(input, ControllingPlayer, out playerIndex) && moveLeft.Evaluate(input, ControllingPlayer, out playerIndex))
{
player.RunLeft();
}
else
{
player.WalkLeft();
}
}
else if (moveRight.Evaluate(input, ControllingPlayer, out playerIndex))
{
if (run.Evaluate(input, ControllingPlayer, out playerIndex) && moveRight.Evaluate(input, ControllingPlayer, out playerIndex))
{
player.RunRight();
}
else
{
player.WalkRight();
}
}
else
{
player.Stop();
}
if (jump.Evaluate(input, ControllingPlayer, out playerIndex))
{
if (player.state == Constants.CharacterState.Jumping)
{
player.DoubleJump();
}
else
player.Jump();
}
if (useSkillCombo.Evaluate(input, ControllingPlayer, out playerIndex))
{
player.UseSkillCombo();
}
else if (useSkill0.Evaluate(input, ControllingPlayer, out playerIndex))
{
player.UseSkill(0);
}
}
else if(player.state == Constants.CharacterState.Climbing)
{
if (moveUp.Evaluate(input, ControllingPlayer, out playerIndex))
{
player.Climb(Constants.DirectionY.Up);
}
else if (moveDown.Evaluate(input, ControllingPlayer, out playerIndex))
{
player.Climb(Constants.DirectionY.Down);
}
else
player.Climb(Constants.DirectionY.Hold);
}
}