frames & 0xFF; $e = $f & 0x3F; $this->position = match ($f >> 6) { 0 => $e < 8 ? $e : 8, 1 => 8, 2 => $e < 8 ? 7 - $e : 0, default => 0, }; if ($f === 0x80) { $this->sounds[] = SoundManager::SFX_SPEAR; } } public function getHurtBox(): ?array { $top = self::POSITIONS[$this->position][2]; return self::box($this->x + 3, $this->y + $top, 3, 0x30 - $top); } public function render(float $cameraX, float $cameraY): void { [$tip, $shafts] = self::POSITIONS[$this->position]; foreach ($shafts as $offset) { $this->blit(self::SHAFT, $this->x, $this->y + $offset, $cameraX, $cameraY); } $this->blit(self::TIP, $this->x, $this->y + $tip, $cameraX, $cameraY); } }