This commit is contained in:
2025-12-19 13:08:51 +08:00
parent fb0276bc4e
commit 56f2f02afe
24 changed files with 6 additions and 3179 deletions

View File

@@ -3,30 +3,12 @@ package game
import (
"time"
"edgaru089.ink/go/gl01/internal/entity"
"edgaru089.ink/go/gl01/internal/render"
"edgaru089.ink/go/gl01/internal/util/itype"
"edgaru089.ink/go/gl01/internal/world"
"github.com/inkyblackness/imgui-go/v4"
_ "edgaru089.ink/go/gl01/internal/entity/entities"
)
// Game holds a game scene.
type Game struct {
world *world.World
player *entity.Entity
view *render.View
render renderData
prevCursorPos itype.Vec2d
cameraPos itype.Vec3d
rotY itype.Angle
rotZ float32 // Degrees in range (-90, 90)
fbSize itype.Vec2i
fullscreen bool
lastPos, lastSize itype.Vec2i // Window size before entering fullscreen
@@ -39,17 +21,5 @@ type Game struct {
// NewGame creates a new, empty Game.
func NewGame() (g *Game) {
return &Game{
world: world.NewWorld(),
player: entity.NewEntity("player", itype.Vec3d{18, 80, 18}),
cameraPos: itype.Vec3d{18, 80, 18},
rotY: 0,
rotZ: 0,
}
}
// LoadGameFromPath loads a saved game from a filesystem folder in a read-write fashion.
func LoadGameFromPath(path string) (g *Game, err error) {
return
return &Game{}
}