tilesetName = RomSprites::SHEET; $this->counter = mt_rand(0, 255); } protected function tick(array $player): void { if ($this->counter === 0x64) { $this->spawns[] = new CannonBall($this->sdl, $this->x + 4, $this->y + 16); $this->sounds[] = 0x1C; $this->blast = 0x18; } if ($this->blast > 0) $this->blast--; $this->counter = ($this->counter + 1) & 0xFF; } public function render(float $cameraX, float $cameraY): void { if ($this->blast <= 0) return; $tiles = self::BLAST[min(2, intdiv(0x18 - $this->blast, 8))]; foreach ($tiles as $i => $tile) { $this->blit(RomSprites::skyTile($tile), $this->x + 8 * $i, $this->y + 16 + 1, $cameraX, $cameraY); } } }