mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
arrow speed depends on how long were u using an item
This commit is contained in:
parent
78a19a7da6
commit
d8e242d0b5
3 changed files with 29 additions and 12 deletions
|
|
@ -59,12 +59,6 @@ class Arrow extends Projectile{
|
|||
//parent::update();
|
||||
$this->needsUpdate = true;
|
||||
|
||||
$this->speedY -= $this->gravity;
|
||||
|
||||
$this->speedX *= 0.99;
|
||||
$this->speedY *= 0.99;
|
||||
$this->speedZ *= 0.99;
|
||||
|
||||
if($this->speedX != 0 or $this->speedY != 0 or $this->speedZ != 0){
|
||||
$f = sqrt(($this->speedX * $this->speedX) + ($this->speedZ * $this->speedZ));
|
||||
$this->yaw = (atan2($this->speedX, $this->speedZ) * 180 / M_PI);
|
||||
|
|
@ -73,6 +67,12 @@ class Arrow extends Projectile{
|
|||
$this->x += $this->speedX;
|
||||
$this->y += $this->speedY;
|
||||
$this->z += $this->speedZ;
|
||||
|
||||
$this->speedX *= 0.99;
|
||||
$this->speedY *= 0.99;
|
||||
$this->speedZ *= 0.99;
|
||||
$this->speedY -= $this->gravity;
|
||||
|
||||
$this->sendMotion();
|
||||
$this->updatePosition();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue