-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (34 loc) · 932 Bytes
/
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
package main
import (
"flag"
"strconv"
"strings"
"github.com/hajimehoshi/ebiten/v2"
"github.com/154pinkchairs/dopewars2d/basegame"
"github.com/154pinkchairs/dopewars2d/core"
"github.com/154pinkchairs/dopewars2d/debug"
"github.com/rs/zerolog/log"
)
func resflag() (int, int) {
// get the resolution in intxint format, parsing the string and converting it to 2 ints
res := strings.Split(flag.Arg(0), "x")
resx, err := strconv.Atoi(res[0])
if err != nil {
panic(err)
}
resy, err := strconv.Atoi(res[1])
if err != nil {
log.Error().Err(err).Msg("non-numeric argument provided")
}
return resx, resy
}
func main() {
ebiten.SetWindowSize(960, 540)
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
ebiten.SetWindowTitle("Dopewars 2D")
logger := debug.SetupLogger()
player := basegame.InitPlayer()
gh := core.NewGameHandler(logger, player)
scr := ebiten.NewImage(960, 540)
gh.DrawMenu(scr)
}