t = 0.0; } public function update(float $dt): void { $this->t += $dt; $a = $this->actions(); if ($this->t > 1 && ($a->isPressed('confirm') || $a->isPressed('back'))) { if ($this->t * 30 < strlen(self::TEXT)) { $this->t = 100; return; } $this->scenes()->switchTo(TitleScene::class); } } public function render(Renderer $r): void { $r->clear([10, 6, 20]); for ($i = 0; $i < 60; $i++) { $r->fillRect(($i * 53) % 320, ($i * 97) % 200, 1, 1, [80 + $i % 120, 70, 120]); } $shown = substr(self::TEXT, 0, (int)($this->t * 30)); $this->font()->draw($r, $shown, 20, 30, 1, [255, 220, 160], 'left', [0, 0, 0]); } }