forked from tdooner/eecs-290-super-power-robots
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Project290/Project290/Games/SuperPowerRobots/Menus/LoadOutMenu.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Project290.Menus; | ||
using Microsoft.Xna.Framework; | ||
using Project290.Inputs; | ||
using Project290.Games.SuperPowerRobots.Menus.MenuDelegates; | ||
|
||
namespace Project290.Games.SuperPowerRobots.Menus | ||
{ | ||
class LoadOutMenu : Menu | ||
{ | ||
public LoadOutMenu(Vector2 position, MenuAction[] actions, float spacing, int count, int[] weapons) | ||
:base(position, actions) | ||
{ | ||
MenuEntry gun = new MenuEntry( | ||
"Gun", | ||
new MenuAction[] | ||
{ | ||
new MenuAction(ActionType.Select, new LoadOutDelegate(count, 0, weapons)) | ||
}, | ||
position); | ||
|
||
MenuEntry axe = new MenuEntry( | ||
"Shield", | ||
new MenuAction[] | ||
{ | ||
new MenuAction(ActionType.Select, new LoadOutDelegate(count, 1, weapons)) | ||
}, | ||
position); | ||
|
||
MenuEntry shield = new MenuEntry( | ||
"Shield", | ||
new MenuAction[] | ||
{ | ||
new MenuAction(ActionType.Select, new LoadOutDelegate(count, 0, weapons)) | ||
}, | ||
position); | ||
} | ||
} | ||
} | ||
|
||
ActionType.Select, new LoadOutDelegate(count, 0, weapons) |
34 changes: 34 additions & 0 deletions
34
Project290/Project290/Games/SuperPowerRobots/Menus/MenuDelegates/LoadOutDelegate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Project290.Menus; | ||
using Project290.Menus.MenuDelegates; | ||
using Project290.GameElements; | ||
|
||
namespace Project290.Games.SuperPowerRobots.Menus.MenuDelegates | ||
{ | ||
class LoadOutDelegate : IMenuDelegate | ||
{ | ||
int[] weapons; | ||
int count; | ||
|
||
public LoadOutDelegate(int count, int type, int[] weapons) | ||
:base() | ||
{ | ||
this.count = count; | ||
this.weapons = weapons; | ||
weapons[count] = type; | ||
count++; | ||
} | ||
|
||
public void Run() | ||
{ | ||
if (count == 3) | ||
{ | ||
GameWorld.screens[GameWorld.screens.Count - 1].Disposed = true; | ||
} | ||
GameWorld.screens.Play(new LoadOutScreen(count, weapons)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters