/// <summary> /// Construct game object /// </summary> public BeatShift() { singleton = this; graphics = new GraphicsDeviceManager(this); //#if XBOX graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; //#endif // TODO: uncomment the above at your peril, performance profiling needed particleManager = new ParticleSystemManager(); Content.RootDirectory = "Content"; contentManager = Content; //Turn on antialiasing graphics.PreferMultiSampling = true; //Profiling option #if DEBUG //this.IsFixedTimeStep = false; //graphics.SynchronizeWithVerticalRetrace = false; #endif //Components.Add(new GamerServicesComponent(this)); //TODO: xbox-live }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (BeatShift game = new BeatShift()) { game.Run(); } }
public InputCombo(BeatShift maingame, PlayerIndex index, int comboLength) { playerIndex = index; game = maingame; combo = new List<String>(); for (int i = 0; i < comboLength; i++) { Random random = new Random(); int comboNumber = random.Next(4); switch (comboNumber) { case 0: combo.Add("X"); break; case 1: combo.Add("Y"); break; case 2: combo.Add("A"); break; case 3: combo.Add("B"); break; } } }
public InputCombo(BeatShift maingame, PlayerIndex index, int comboLength) { playerIndex = index; game = maingame; combo = new List <String>(); for (int i = 0; i < comboLength; i++) { Random random = new Random(); int comboNumber = random.Next(4); switch (comboNumber) { case 0: combo.Add("X"); break; case 1: combo.Add("Y"); break; case 2: combo.Add("A"); break; case 3: combo.Add("B"); break; } } }
public NetworkedGame(BeatShift game) : base(game) { mainGame = game; // Add the game object to the components list // This seems to be done in every example, so I'm adding it here. // I have a feeling it allows us to use Live. //mainGame.Components.Add(new GamerServicesComponent(mainGame)); //http://msdn.microsoft.com/en-us/library/bb975692.aspx // Listen for invite notification events. This handler will be called // whenever the user accepts an invite message, or if they select the // "Join Session In Progress" option from their Guide friends screen. NetworkSession.InviteAccepted += InviteAcceptedEventHandler; }
public static void initializeGamerServices(BeatShift mainGame) { #if (XBOX || DEBUG) // Console.Write("Initializing networking (GamerServicesDispatcher)... "); //This block of code needs to be uncommented somewhere //Unfortunately it is very slow (5s) on my PC and delays //Startup significantly. try { GamerServicesDispatcher.WindowHandle = mainGame.Window.Handle; if (!GamerServicesDispatcher.IsInitialized) GamerServicesDispatcher.Initialize(mainGame.Services); } catch (Exception e) { //DO SOMTHING SENSIBLE HERE. //triggered if live services not running Console.WriteLine("Unable to initialize GamerServicesDispatcher."); } // Console.WriteLine(" ...done."); #endif }
public static void initializeGamerServices(BeatShift mainGame) { #if (XBOX || DEBUG) // Console.Write("Initializing networking (GamerServicesDispatcher)... "); //This block of code needs to be uncommented somewhere //Unfortunately it is very slow (5s) on my PC and delays //Startup significantly. try { GamerServicesDispatcher.WindowHandle = mainGame.Window.Handle; if (!GamerServicesDispatcher.IsInitialized) { GamerServicesDispatcher.Initialize(mainGame.Services); } } catch (Exception e) { //DO SOMTHING SENSIBLE HERE. //triggered if live services not running Console.WriteLine("Unable to initialize GamerServicesDispatcher."); } // Console.WriteLine(" ...done."); #endif }
PlayerIndex playerIndex; //No Longer Used #endregion Fields #region Constructors public InputCombo(BeatShift maingame, PlayerIndex index) : this(maingame, index, 4) { }
public InputCombo(BeatShift maingame, PlayerIndex index) : this(maingame, index, 4) { }