package game import ( "image" "github.com/hajimehoshi/ebiten/v2" "github.com/mlange-42/arche/ecs" ) type Game struct { World *ecs.World Bounds image.Rectangle ScreenWidth, ScreenHeight int CurrentLevel int Scenes []Scene } func NewGame(width, height, startlevel int) *Game { world := ecs.NewWorld() game := &Game{ Bounds: image.Rectangle{}, CurrentLevel: startlevel, World: &world, ScreenWidth: width, ScreenHeight: height, } levelscene := NewLevelScene(game, startlevel) game.Scenes = append(game.Scenes, levelscene) return game } func (game *Game) Update() error { for _, scene := range game.Scenes { scene.Update() } return nil } func (game *Game) Draw(screen *ebiten.Image) { for _, scene := range game.Scenes { scene.Draw(screen) } } func (g *Game) Layout(newWidth, newHeight int) (int, int) { return g.ScreenWidth, g.ScreenHeight }