package main

import (
	"log"
	"mover/assets"
	"mover/gamedata"
	"mover/screenmanager"
	"mover/screens"

	"github.com/hajimehoshi/ebiten/v2"
)

const (
	screenWidth  = 640
	screenHeight = 480
)

func main() {
	//moverGame := &Game{}
	moverGame := screenmanager.NewManager()
	moverGame.SetDimensions(gamedata.Area{Width: screenWidth, Height: screenHeight})

	ebiten.SetWindowSize(screenWidth*1.5, screenHeight*1.5)
	ebiten.SetWindowTitle(moverGame.Info.Name + ": v" + moverGame.Info.Version)

	loadScreens(&moverGame)

	if err := ebiten.RunGame(&moverGame); err != nil {
		log.Fatal(err)
	}

}

func loadScreens(m *screenmanager.Manager) {
	assets.LoadImages()
	assets.LoadSounds()
	m.AddScene(screens.NewStartScreen())
	//m.AddScene(screens.NewGame())
	m.AddScene(screens.NewPrimary())
	m.ResetScenes()
}
