Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StartMenu : Menu
- {
- List of Buttons
- Button StartButton = new Button(top center, 2 x 4, texture)
- Button OptionsButton = new Button(middle center, 2 x 4, texture)
- Button ExitButton = new Button(bottom center, 2 x 4, texture)
- Update()
- {
- foreach(Button in the list of buttons)
- {
- Button.CheckifHighlighted()
- Button.CheckifSelected()
- if(Button.Selected == true)
- {
- switch(Button.Name)
- case StartButton
- gamestate = loadlevel
- break;
- case OptionsButton
- add options menu to top of list of menus
- break;
- case ExitButton
- exit game
- break;
- }
- }
- }
- Draw()
- {
- foreach(Button in the list of buttons)
- {
- Button.DrawGraphics()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement