title = (string)($params['text'] ?? ''); $this->again = $params['again'] ?? null; parent::enter($params); } protected function items(): array { $items = []; if ($this->again !== null) { $items[] = ['PLAY AGAIN', null, fn () => $this->scenes()->switchTo(PlayScene::class, $this->again)]; } $items[] = ['TITLE SCREEN', null, function (): void { $this->engine->net()->close(); $this->scenes()->switchTo(TitleScene::class); }]; return $items; } }