...
1 package adventure
2
3 import (
4 "github.com/hajimehoshi/ebiten"
5 "gitlab.com/tslocum/venture/pkg/engine"
6 "gitlab.com/tslocum/venture/pkg/world"
7 )
8
9 type Game struct {
10 *engine.Game
11
12 Root *world.Scene
13 }
14
15 func NewAdventureGame() *Game {
16 baseGame := engine.NewGame()
17
18 g := Game{Game: baseGame, Root: world.NewScene(nil)}
19
20 baseGame.UpdateFunc = g.UpdateGame
21 baseGame.SetRoot(g.Root)
22
23 return &g
24 }
25
26 func (g *Game) UpdateGame(screen *ebiten.Image) error {
27 return nil
28 }
29
30 func (g *Game) AddObject(object Object) {
31 g.Root.AddNode(object)
32 }
33
View as plain text