-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
45 lines (37 loc) · 844 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
package main
import (
"log"
"github.com/hajimehoshi/ebiten/v2"
)
const (
GameStateMenu = iota
GameStatePlaying
GameStateWin
GameStateLose
)
const (
ScreenWidth = 1280
ScreenHeight = 960
BackgroundWidth = 1280 * 4
ScrollSpeed = 2
)
var(
doorPosition = Vector{X: BackgroundWidth - 300, Y: ScreenHeight / 2}
menuOptions = []string{"EASY", "NORMAL", "DIFFICULT", "", "EXIT"}
)
func main() {
game := &Game{
state: GameStateMenu,
PlayerOrigin: Vector{X: 100, Y: 350},
PlayerPosition: Vector{X: 100, Y: 350},
}
game.currentMenuOption = 0
game.init()
ebiten.SetWindowTitle("GoFlappy")
ebiten.SetWindowSize(ScreenWidth, ScreenHeight)
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
ebiten.ActualFPS()
if err := ebiten.RunGame(game); err != nil {
log.Fatal(err)
}
}