counter = ($this->counter + 1) % 0xA0; if ($this->counter === 0x64) { $this->sounds[] = SoundManager::SFX_ELECTRIC; } } public function getHurtBox(): ?array { return $this->counter >= 0x64 ? self::box($this->x, $this->y, 48, 16) : null; } public function render(float $cameraX, float $cameraY): void { if ($this->counter < 0x46) return; if ($this->counter < 0x64) { // warning: the spark blinks (layout frames 2 / 3 alternate every frame) if ($this->frames & 1) { $this->blit(self::SPARK, $this->x + 16, $this->y, $cameraX, $cameraY); } return; } $this->blit(self::SPHERE, $this->x, $this->y, $cameraX, $cameraY); $this->blit(self::SPARK, $this->x + 16, $this->y, $cameraX, $cameraY); $this->blit(self::SPHERE, $this->x + 32, $this->y, $cameraX, $cameraY); } }