$this->scenes()->pop()], ['TITLE SCREEN', null, fn () => $this->scenes()->switchTo(TitleScene::class)], ]; } protected function back(): void { $this->scenes()->pop(); } public function update(float $dt): void { // P / Start resumes too (Escape is both 'pause' and 'back': back() already handles it) if ($this->actions()->isPressed('pause') && !$this->actions()->isPressed('back')) { $this->scenes()->pop(); return; } parent::update($dt); } }