engine); parent::enter($params); if (!$this->sdl()->hasTexture('title')) { $this->sdl()->loadTexture('title', 'assets/title/title.png'); } if ($this->sound()->getCurrentMusic() !== 'title') { $this->sound()->playMusic('title'); } } protected function items(): array { return [['PLAY', null, fn () => $this->scenes()->switchTo(PlayScene::class)]]; } protected function back(): void { $this->scenes()->push(OptionsScene::class); } public function update(float $dt): void { if ($this->actions()->isPressed('fire') || $this->actions()->isPressed('jump')) { $this->sound()->playSfx('menu_confirm'); $this->scenes()->switchTo(PlayScene::class); return; } parent::update($dt); } public function render(Renderer $r): void { $title = $this->sdl()->getTexture('title')['texture']; if ($this->engine->lang->getLang() === 'es') { $r->copy($title, null, 0, 0); return; } $r->clear([0, 0, 0]); $r->copy($title, [0, 128, 320, 72], 0, 128, 320, 72); foreach (self::CREDITS as $row => $line) { $this->font()->draw($r, Lang::t($line), 160, $row * 16, 1, self::BLUE, 'center'); } } }