applyGravity) && (!$this->isGrounded())) { $this->ay = $this->gravity; if ($this->vy > $this->maxFallSpeed) { $this->vy = $this->maxFallSpeed; $this->ay = 0; } } } public function setGravity(float $gravity) { $this->gravity = $gravity; } public function getGravity(): float { return $this->gravity; } public function setApplyGravity(bool $apply) { $this->applyGravity = $apply; } }