arrow speed depends on how long were u using an item

This commit is contained in:
GameHerobrine 2023-07-05 10:30:55 +03:00
parent 78a19a7da6
commit d8e242d0b5
3 changed files with 29 additions and 12 deletions

View file

@ -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();
}