-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
51 lines (41 loc) · 1005 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
47
48
49
50
51
package main
import (
"image/color"
"github.com/hajimehoshi/ebiten/v2"
)
const w = 400
const h = 520
const bs = 360
var bg = color.White
var fg = color.Black
var white = color.RGBA{R: 200, G: 200, B: 200, A: 255}
var level Level
var state []*State
var menuImage *ebiten.Image
type Game struct {
splashScreenImage *ebiten.Image
splashScreenCountdown int
level int
menu bool
}
func main() {
ebiten.SetWindowTitle("attraction")
ebiten.SetWindowSize(w, h)
menuImage = generateMenuImage()
// we're going to use the functions that generate
// pieces for the help screen, and that requires a
// level in order to know how big to make them
level = Level{cells: 12}
helpSplash = generateHelpSplashScreen()
err := ebiten.RunGame(&Game{
splashScreenImage: generateStartingSplashScreen(),
splashScreenCountdown: 240,
menu: true,
})
if err != nil {
panic(err)
}
}
func (g *Game) Layout(int, int) (int, int) {
return w, h
}