delay = mt_rand(0, 31) + 1; $this->tilesetName = RomSprites::SHEET; } public function setCameraY(float $cameraY): void { $this->cameraY = $cameraY; } protected function tick(array $player): void { if (!$this->falling) { if (--$this->delay > 0) return; $this->falling = true; $this->sounds[] = 0x20; } $this->speed = min(4, $this->speed + 0x20 / 256); $this->y += $this->speed; if ($this->y > $this->cameraY + 256) { $this->active = false; $this->visible = false; } } public function isFalling(): bool { return $this->falling; } /** Top of the plank, Sonic stands on it. */ public function getTop(): float { return $this->y + 16; } public function render(float $cameraX, float $cameraY): void { // sprite layout _8481: an empty row, then tiles $70 $72 (the VDP draws one line lower) $this->blit(RomSprites::BRIDGE_PLANK, $this->x, $this->y + 16 + 1, $cameraX, $cameraY); } }