-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
49 lines (38 loc) · 1.05 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
_ "image/png"
"log" // Adjust based on where these are defined
"github.com/hajimehoshi/ebiten/v2"
// Import your internal package
core "openFE/internal/core" // Use alias to avoid conflict
)
var (
game *core.Game
)
func init() {
core.LoadSpritesheets()
unitInfo := core.RPG{Job: core.NOBLE, Movement: 2}
u := core.CreateUnit(0, core.UnitSprite, unitInfo, core.PosXY{0, 1})
i := core.CreateUnit(1, core.UnitSprite, unitInfo, core.PosXY{1, 0})
units := []core.Unit{u, i}
unitPointers := make([]*core.Unit, len(units))
for i := range units {
unitPointers[i] = &units[i]
}
mgrid := core.CreateMGrid(unitPointers, core.CursorSprite, core.LdtkProject)
game = &core.Game{
Camera: core.Camera{X: 0, Y: 0},
MG: mgrid,
History: []core.MGrid{},
}
game.AppendHistory(game.MG)
game.IncrementActionCounter()
}
func main() {
ebiten.SetWindowSize(core.ScreenWidth*2, core.ScreenHeight*2)
ebiten.SetWindowTitle("Platformer")
// ebiten.SetFullscreen(true)
if err := ebiten.RunGame(game); err != nil {
log.Fatal(err)
}
}