70 lines
2.3 KiB
Go

package screens
import (
"lab.zaar.be/thefish/alchemyst-go/engine/types"
"lab.zaar.be/thefish/alchemyst-go/ui/mainwindow"
blt "lab.zaar.be/thefish/bearlibterminal"
)
type TitleScreen struct {
mw *mainwindow.MainWindow
scm *types.ScreenManager
}
func NewTitleScreen(mw *mainwindow.MainWindow, scm *types.ScreenManager) *TitleScreen {
return &TitleScreen{mw: mw, scm: scm}
}
func (ts *TitleScreen) UseEcs() bool { return false }
func (ts *TitleScreen) Enter() {
blt.Clear()
}
func (ts *TitleScreen) HandleInput(input string) {
switch input {
case "n":
ts.scm.SetScreenByName("game")
}
}
func (ts *TitleScreen) Exit() {
blt.Clear()
}
func (ts *TitleScreen) Render() {
blt.PrintExt(0, 2, ts.mw.W, ts.mw.H, blt.TK_ALIGN_CENTER, logo)
blt.PrintExt(0, 19, ts.mw.W, ts.mw.H, blt.TK_ALIGN_CENTER, menu)
blt.PrintExt(0, 35, ts.mw.W, ts.mw.H, 3, credits)
}
var logo = `
.ddxo. .c c xlx
.kd. .0o:O, c0uO'
xc 0; x: ko ,,
;l Y; c, .Yct;
.. .. .......
:o: :k; .cxloOo x0. kO .olldk; do .;k lO. dO 'xllxk; ocokk:dl
.lKO, .kl 'dl c l0l..;dK lkx..;d: dOx .cOx ,0o c0 kk. .Y .Oo
.l0.k0. .0l lK. l0oxxxOK OK;xxx kKOklOkx ,kO;'do. ;xO: .Oo
:OoooxO .Ol ;Xc , cK' dK xX. , Ox YY xx ,O0. . .oKx. .0o
;k. .Ox Ok..'.,l ;Kk:;dk cKl lX: dKc,;oc kx kk OO dKl;lk: .0O
l; ,o .kK0KKK; :Ok; c; l: .oxc. x: Ol xl .dk: .o
`
var menu = `
Alchemyst (c) 2011-2014 thefish <thefish@zaar.be>
[color=green]N[/color]ew dungeon run
[color=green]L[/color]oad saved game
Read [color=green]h[/color]elp file
Highest [color=green]S[/color]cores
`
var credits = `
Roguebasin Libtcod Tutorial (c) 2010-2011, Jotaf Henriques
Brogue 1.3 (c) 2010 Brian Walker
Madness (c) 2010 hmp <humpolec@gmail.com>
BearLibTerminal (c) Cfyz 2009-2019 <http://foo.wyrd.name/en:bearlibterminal>
Gogue (c) jcerise
`