public PlayerManager(Game1 game) { currentPlayer = 1; this.game = game; charList = (List<Character>)game.Services.GetService(typeof(List<Character>)); this.gameTime = (GameTime)game.Services.GetService(typeof(GameTime)); }
public ChampionOne(Game1 game, int xLoc, int yLoc, int playerIndex) : base(game, xLoc, yLoc) { map = (BattleMap)game.Services.GetService(typeof(BattleMap)); gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager)); screenManager = (ScreenManager)game.Services.GetService(typeof(ScreenManager)); this.game = game; walk = new Texture2D[2]; attack = new Texture2D[5]; PlayerIndex = playerIndex; Initialize(); LoadContent(); this.Move(xLoc, yLoc); PlayerIndex = playerIndex; HasMoved = false; HasAttacked = false; Alive = true; CharType = "champion"; MoveDistance = 4; HealthPoints = 50; Strength = 20; PDefense = 15; MDefense = 15; Dexterity = 10; AttackRange = 1; CurrentHealth = HealthPoints; Gold = 500; Level = 2; Experience = 0; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
static void ShowScreenSaver(IntPtr parentHwnd) { using (Game1 game = new Game1(parentHwnd)) { game.Run(); } }
static void ShowScreenSaver() { using (Game1 game = new Game1()) { game.Run(); } }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; // When the constructor is called assign the static instance to be the object Instance = this; }
public static void changeState(GameState gs, Game1 game) { currentGameState = gs; if (gs == GameState.Menu) game.Window.Title = "Menu"; else if (gs == GameState.CountryGuide) game.Window.Title = "Guide"; else if (gs == GameState.GameNormal) game.Window.Title = ""; else if (gs == GameState.GameTime) game.Window.Title = ""; else if (gs == GameState.GamePractice) game.Window.Title = ""; else if (gs == GameState.Help) game.Window.Title = ""; }
/// <summary> public MainMenuScreen(Game1 game) : base("Main Menu") { // Create our menu entries. MenuEntry playGameMenuEntry = new MenuEntry("Play Game"); MenuEntry exitMenuEntry = new MenuEntry("Exit"); this.game = game; // Hook up menu event handlers. playGameMenuEntry.Selected += PlayGameMenuEntrySelected; exitMenuEntry.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(playGameMenuEntry); MenuEntries.Add(exitMenuEntry); gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager)); }
public MercenaryCamp(Game1 game, int xLoc, int yLoc) : base(game, xLoc, yLoc) { map = (BattleMap)game.Services.GetService(typeof(BattleMap)); gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager)); map.GetSquare(yLoc, xLoc).setCurrentChar(this); Initialize(); LoadContent(); position.X = xLoc * 60; position.Y = yLoc * 60 + 20; Alive = true; HasAttacked = false; HasMoved = false; CharType = "camp"; HealthPoints = 100; }
public OptionsScreen(Game1 game) { const string usageText = "Play Against AI?\n" + "A: Yes B: No"; this.message = message + usageText; IsPopup = true; TransitionOnTime = TimeSpan.FromSeconds(0.2); TransitionOffTime = TimeSpan.FromSeconds(0.2); menuAccept = new InputAction( new Buttons[] { Buttons.A }, new Keys[] { Keys.A }, true); menuCancel = new InputAction( new Buttons[] { Buttons.B }, new Keys[] { Keys.B }, true); this.game = game; }
public void LoadAI(Game1 game) { ai = (OpponentAI)game.Services.GetService(typeof(OpponentAI)); }