Jumping/ja: Difference between revisions

From Minecraft Parkour Wiki
Content added Content deleted
(Created page with "== 発動 ==")
(Created page with "そのため、ダッシュジャンプは速度を高め、保持するのに非常に効率的な方法となっている。")
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
<div lang="en" dir="ltr" class="mw-content-ltr">
__NOTOC__
__NOTOC__
ジャンプは、言わずと知れた、極めて重要な仕組みである。
Jumping is an essential mechanic that is quite self-explanatory.
</div>




Line 9: Line 7:
== 発動 ==
== 発動 ==


ジャンプするには、その前の[[Special:MyLanguage/Ticks|tick]]で地面に立っている必要がある。ブロック縁からでも1tick走って(例:[[Special:MyLanguage/Timings|ずらし]])ジャンプできるのはこのためである。
<div lang="en" dir="ltr" class="mw-content-ltr">
To start a jump, the player must have been on ground the previous [[Special:MyLanguage/Ticks|tick]]. This is why the player is able to run off a block for 1 tick (e.g. with a [[Special:MyLanguage/Timings|headhitter timing]]) and still be able to jump.
</div>


ジャンプキーを押し続けていると、10tick(0.5秒)ごとに1回ジャンプできる。
<div lang="en" dir="ltr" class="mw-content-ltr">
When the Jump key is held, the player jumps at most once every 10 ticks (0.5s)
</div>


* 各ジャンプの高さが0.75b以上の場合、ジャンプキーを押し続けるのは最適ではない(結果: ブロックを積み上げる時は押し直しの方が速い)。
<div lang="en" dir="ltr" class="mw-content-ltr">
* ジャンプキーを離すとクールダウンがリセットされるため、その次tickで再度ジャンプできる。
* Holding jump is not optimal when going up by more than 0.75b per jump. (consequence: towering is faster when jumping manually)
* Releasing jump resets the cooldown, making the player able to jump again on the next tick.
</div>


ジャンプすると、垂直方向の速度が0.42に設定される。その後毎tick、速度は0.08減少(重力)の後、0.98倍(空気抵抗)される。
<div lang="en" dir="ltr" class="mw-content-ltr">
When a jump is initiated, the player's vertical speed is set to 0.42. On every following tick, it is decreased by 0.08 (gravity), then multiplied by 0.98 (drag).
</div>


* 天井にぶつかると、垂直方向の速度が0に設定され、すぐに落下し始める。
<div lang="en" dir="ltr" class="mw-content-ltr">
* 地面にぶつかると、垂直方向の速度が0に設定され、<code>onGround</code>フラグがtrueになる。
* When the player hits a ceiling, their vertical speed is set to 0 and they immediately start falling.
[[Special:MyLanguage/Water and Lava|水/溶岩]]の中でジャンプすると、上方向に移動する。
* When the player hits the ground, their vertical speed is set to 0 and the <code>onGround</code> flag is set as true.
Jumping in [[Special:MyLanguage/Water and Lava|water or lava]] makes the player move upward.
</div>




Line 36: Line 24:
== ジャンプの高さ ==
== ジャンプの高さ ==


1.8以前はジャンプの最高点は'''1.249b'''。1.9で約0.003b上昇し、'''1.252b'''の高さまでジャンプできるようになった。
<div lang="en" dir="ltr" class="mw-content-ltr">
Prior to 1.9, the maximum jump height is '''1.249b'''. It is increased in 1.9+ by ~0.003b, making the player able to jump '''1.252b''' high.
</div>


平らな地面では、1ジャンプの滞空時間は'''12[[Special:MyLanguage/ticks|tick]]'''(0.6秒)。
<div lang="en" dir="ltr" class="mw-content-ltr">
On flat ground, a jump lasts '''12 [[Special:MyLanguage/ticks|ticks]]''' (0.6s).
</div>




Line 48: Line 32:
== 速度 ==
== 速度 ==


[[Special:MyLanguage/Sprinting|ダッシュ]]と組み合わせた場合、ジャンプすると向いている方向に0.2の加速度が得られる。
<div lang="en" dir="ltr" class="mw-content-ltr">
When combined with [[Special:MyLanguage/Sprinting|Sprinting]], jumping adds 0.2 units of acceleration towards the player's facing.
</div>


空中では、加速は遅くなるが(基本加速度の20%のみ)、より多くの速度が保持される(毎tick、地面での54.6%に対し91%)。
<div lang="en" dir="ltr" class="mw-content-ltr">
In air, the player accelerates less quickly (only 20% of the base acceleration value), but conserves more speed (91% every tick, instead of 54.6%).
</div>


そのため、ダッシュジャンプは速度を高め、保持するのに非常に効率的な方法となっている。
<div lang="en" dir="ltr" class="mw-content-ltr">
Therefore, sprint-jumping is a very efficient way to build and conserve speed.
</div>




Line 64: Line 42:
== ソースコード ==
== ソースコード ==


以下はジャンプがどのように発動しているかに関するコード。<syntaxhighlight lang="java">
<div lang="en" dir="ltr" class="mw-content-ltr">
/* EntityLivingBase.javaから、無関係なコードは削除 */
The following snippets of code deal with how jump is activated.<syntaxhighlight lang="java">
/* From EntityLivingBase.java, stripped of irrelevant code */
public void onLivingUpdate()
public void onLivingUpdate()
{
{
if (this.jumpTicks > 0)
if (this.jumpTicks > 0)
--this.jumpTicks;
--this.jumpTicks;
</div>


if (this.isJumping)
<div lang="en" dir="ltr" class="mw-content-ltr">
if (this.isJumping)
{
{
if (this.isInWater())
if (this.isInWater())
this.handleJumpWater(); //motionY += 0.04
this.handleJumpWater(); //motionY += 0.04
</div>


else if (this.isInLava())
<div lang="en" dir="ltr" class="mw-content-ltr">
else if (this.isInLava())
this.handleJumpLava(); //motionY += 0.04
this.handleJumpLava(); //motionY += 0.04
</div>


else if (this.onGround && this.jumpTicks == 0)
else if (this.onGround && this.jumpTicks == 0)
Line 92: Line 64:
}
}


//ジャンプキーを離すと10tickのクールダウンがリセットされる
<div lang="en" dir="ltr" class="mw-content-ltr">
//releasing the jump key resets the 10 tick cooldown.
else
else
this.jumpTicks = 0;
this.jumpTicks = 0;
}
}
</div>




/* EntityLivingBase.javaから */
<div lang="en" dir="ltr" class="mw-content-ltr">
/* From EntityLivingBase.java */
protected void jump()
protected void jump()
{
{
this.motionY = 0.42; //Initial speed
this.motionY = 0.42; //初速
</div>


//跳躍力上昇の適用
<div lang="en" dir="ltr" class="mw-content-ltr">
//apply jump boost
if (this.isPotionActive(Potion.jump))
if (this.isPotionActive(Potion.jump))
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
</div>


//ダッシュジャンプのブーストの適用
<div lang="en" dir="ltr" class="mw-content-ltr">
//apply sprintjump boost
if (this.isSprinting())
if (this.isSprinting())
{
{
float f = this.rotationYaw * 0.017453292F; //multiply by pi/180 to convert to radians
float f = this.rotationYaw * 0.017453292F; //pi/180をかけてラジアンに変換
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
Line 123: Line 88:
}
}
</syntaxhighlight>
</syntaxhighlight>
</div>

Latest revision as of 12:33, 8 June 2022

Other languages:

ジャンプは、言わずと知れた、極めて重要な仕組みである。


発動

ジャンプするには、その前のtickで地面に立っている必要がある。ブロック縁からでも1tick走って(例:ずらし)ジャンプできるのはこのためである。

ジャンプキーを押し続けていると、10tick(0.5秒)ごとに1回ジャンプできる。

  • 各ジャンプの高さが0.75b以上の場合、ジャンプキーを押し続けるのは最適ではない(結果: ブロックを積み上げる時は押し直しの方が速い)。
  • ジャンプキーを離すとクールダウンがリセットされるため、その次tickで再度ジャンプできる。

ジャンプすると、垂直方向の速度が0.42に設定される。その後毎tick、速度は0.08減少(重力)の後、0.98倍(空気抵抗)される。

  • 天井にぶつかると、垂直方向の速度が0に設定され、すぐに落下し始める。
  • 地面にぶつかると、垂直方向の速度が0に設定され、onGroundフラグがtrueになる。

水/溶岩の中でジャンプすると、上方向に移動する。


ジャンプの高さ

1.8以前はジャンプの最高点は1.249b。1.9で約0.003b上昇し、1.252bの高さまでジャンプできるようになった。

平らな地面では、1ジャンプの滞空時間は12tick(0.6秒)。


速度

ダッシュと組み合わせた場合、ジャンプすると向いている方向に0.2の加速度が得られる。

空中では、加速は遅くなるが(基本加速度の20%のみ)、より多くの速度が保持される(毎tick、地面での54.6%に対し91%)。

そのため、ダッシュジャンプは速度を高め、保持するのに非常に効率的な方法となっている。


ソースコード

以下はジャンプがどのように発動しているかに関するコード。

/* EntityLivingBase.javaから、無関係なコードは削除 */
public void onLivingUpdate()
{
    if (this.jumpTicks > 0)
        --this.jumpTicks;

    if (this.isJumping)
    {
        if (this.isInWater())
            this.handleJumpWater(); //motionY += 0.04

        else if (this.isInLava())
            this.handleJumpLava();  //motionY += 0.04

        else if (this.onGround && this.jumpTicks == 0)
        {
                this.jump();
                this.jumpTicks = 10;
        }
    }

    //ジャンプキーを離すと10tickのクールダウンがリセットされる
    else
        this.jumpTicks = 0;
}


/* EntityLivingBase.javaから */
protected void jump()
{
    this.motionY = 0.42; //初速

    //跳躍力上昇の適用
    if (this.isPotionActive(Potion.jump))
        this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;

    //ダッシュジャンプのブーストの適用
    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F; //pi/180をかけてラジアンに変換
        this.motionX -= MathHelper.sin(f) * 0.2F;
        this.motionZ += MathHelper.cos(f) * 0.2F;
    }
}