-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (36 loc) · 854 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
41
42
43
44
45
46
package main
import (
_ "github.com/codecat/go-enet"
"github.com/corentin35000/Go-Ebitengine/src/sceneManager"
"github.com/hajimehoshi/ebiten/v2"
_ "github.com/hajimehoshi/ebiten/v2/text"
_ "golang.org/x/image/font"
_ "golang.org/x/image/font/opentype"
"log"
)
type Game struct{}
const (
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
)
var fpsCurrent float64 = ebiten.CurrentFPS()
func init() {
ebiten.SetFullscreen(true)
ebiten.SetWindowTitle("By Corentin")
//sceneManager.Init(SCREENWIDTH, SCREENHEIGTH)
}
func (g *Game) Update() error {
sceneManager.Update()
return nil
}
func (g *Game) Draw(screen *ebiten.Image) {
sceneManager.Draw()
}
func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
return 1280, 780
}
func main() {
if err := ebiten.RunGame(&Game{}); err != nil {
log.Fatal(err)
}
}