startX = $this->x; $this->speed = $type === 0x14 ? 1.5 : -1.5; $this->sounds[] = SoundManager::SFX_FIREBALL; } protected function tick(array $player): void { if ($this->counter < 0x64) { $this->x += $this->speed; } if (++$this->counter >= 0xF0) { $this->counter = 0; $this->x = $this->startX; $this->sounds[] = SoundManager::SFX_FIREBALL; } } public function getHurtBox(): ?array { return $this->counter < 0x64 ? self::box($this->x, $this->y + 4, 6, 8) : null; } public function render(float $cameraX, float $cameraY): void { if ($this->counter >= 0x64) return; $this->blit($this->speed > 0 ? self::RIGHT : self::LEFT, $this->x, $this->y, $cameraX, $cameraY); } }