Reshuffled menu items, added new intermediary screen between splash and menu (secondary logo).
This commit is contained in:
@@ -15,7 +15,7 @@ func main() {
|
||||
//setup manager
|
||||
manager := groovy.NewManager()
|
||||
manager.SetDimensions(groovy.Area{Width: 1280, Height: 720})
|
||||
ebiten.SetWindowSize(manager.Info.Dimension.Width, manager.Info.Dimension.Height)
|
||||
ebiten.SetWindowSize(manager.Info.Dimensions.Width, manager.Info.Dimensions.Height)
|
||||
ebiten.SetWindowTitle(manager.Info.Name)
|
||||
|
||||
loadScenes(&manager)
|
||||
@@ -33,6 +33,7 @@ func main() {
|
||||
func loadScenes(m *groovy.Manager) {
|
||||
//call the loaders for each scene
|
||||
loadSplash(m)
|
||||
loadBsoft(m)
|
||||
loadMenu(m)
|
||||
|
||||
//reset the manager to start scene 1
|
||||
@@ -52,10 +53,24 @@ func loadMenu(m *groovy.Manager) {
|
||||
sceneMenu := splashmenu.NewMenu()
|
||||
sceneMenu.SetOptions(map[int]splashmenu.MenuOption{
|
||||
1: {Description: "splash", SelectionEvent: groovy.RESET, Mapping: ebiten.Key1},
|
||||
2: {Description: "menu"},
|
||||
3: {Description: "swing"},
|
||||
4: {Description: "exit", SelectionEvent: groovy.ENDGAME, Mapping: ebiten.Key4},
|
||||
2: {Description: "bsoft", SelectionEvent: groovy.COMPLETED, Mapping: ebiten.Key2},
|
||||
3: {Description: "menu"},
|
||||
4: {Description: "swing"},
|
||||
5: {Description: "exit", SelectionEvent: groovy.ENDGAME, Mapping: ebiten.Key5},
|
||||
})
|
||||
|
||||
m.AddScene(&sceneMenu)
|
||||
|
||||
//set up a custom event handler for the menu completion >:]
|
||||
scene := m.GetScene(m.SceneCount() - 1)
|
||||
scene.SetEventHandler(groovy.COMPLETED, func() {
|
||||
//direct manager to update current scene by retrieving menu selection
|
||||
sceneSelected := sceneMenu.GetMenuSelection() - 1
|
||||
m.SetCurrentScene(sceneSelected)
|
||||
})
|
||||
}
|
||||
|
||||
func loadBsoft(m *groovy.Manager) {
|
||||
sceneBsoft := splashmenu.NewBsoft()
|
||||
m.AddScene(&sceneBsoft)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user