/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); #if WINDOWS_PHONE viewportSize = new Vector2(640, 480); PhoneScale = 0.8f; #endif graphics.PreferredBackBufferWidth = (int)viewportSize.X; graphics.PreferredBackBufferHeight = (int)viewportSize.Y; IsMouseVisible = true; graphics.IsFullScreen = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); LoadingScreen.Load(screenManager, false, null, new QuickMenuScreen()); // TEST LEVELS //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0; bloom = new BloomComponent(this); Components.Add(bloom); bloom.Settings = BloomSettings.PresetSettings[5 % BloomSettings.PresetSettings.Length]; #if DEBUG Components.Add(new DebugComponent(this)); //Level Menu LoadingScreen.Load(screenManager, false, null, new BackgroundScreen(), new MainMenuScreen() );// , new LevelMenuScreen()); //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else graphics.IsFullScreen = true; LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); #if DEBUG Components.Add(new DebugComponent(this)); // TEST LEVELS LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else //graphics.IsFullScreen = true; //LoadingScreen.Load(screenManager, true, null, new QuickMenuScreen()); LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }
public Level(ScreenManager screenManager, int levelIndex) { this.gameContent = screenManager.GameContent; this.levelIndex = levelIndex; Load(); }
/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; TransitionOnTime = TimeSpan.FromSeconds(0.5); }
public Level(ScreenManager screenManager, int levelIndex) { this.gameContent = screenManager.GameContent; this.levelIndex = levelIndex; for (int i = 0; i < GameContent.MaxGoals; i++) blockNumber[i] = gameContent.random.Next(gameContent.blockCount[i]); LoadBlocks(levelIndex); }
public Level(ScreenManager screenManager, int levelIndex) { this.gameContent = screenManager.GameContent; this.levelIndex = levelIndex; LoadTiles(levelIndex); if (blocks.Count == 4) timeBonus = 10; if (blocks.Count == 9) timeBonus = 20; if (blocks.Count == 16) timeBonus = 30; }
public Level(ScreenManager screenManager, int levelIndex) { this.gameContent = screenManager.GameContent; this.levelIndex = levelIndex; basicEffect = new BasicEffect(screenManager.GraphicsDevice); basicEffect.VertexColorEnabled = true; //Render._device = screenManager.GraphicsDevice; //Render._batch = screenManager.SpriteBatch; //Render._font = debugFont; }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); ScoreData = ScoreData.Load(GameContent.MaxLevelIndex); Settings = Settings.Load(); #if WINDOWS graphics.IsFullScreen = Settings.IsFullScreen; ViewportSize = new Vector2(800, 600); #endif #if WINDOWS_PHONE TargetElapsedTime = TimeSpan.FromTicks(333333); ViewportSize = new Vector2(640, 480); graphics.IsFullScreen = true; #endif graphics.PreferredBackBufferWidth = (int)ViewportSize.X; graphics.PreferredBackBufferHeight = (int)ViewportSize.Y; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); #if WINDOWS //graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0; bloom = new BloomComponent(this); Components.Add(bloom); bloom.Settings = BloomSettings.PresetSettings[5 % BloomSettings.PresetSettings.Length]; #endif #if DEBUG && WINDOWS Components.Add(new DebugComponent(this)); //Level Menu LoadingScreen.Load(screenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new BackgroundScreen(), new MainMenuScreen() // , new LabScreen()); //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else //graphics.IsFullScreen = true; LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }
/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; if (loadingIsSlow) { TransitionOnTime = TimeSpan.FromSeconds(.1); TransitionOffTime = TimeSpan.FromSeconds(2); } else TransitionOnTime = TimeSpan.FromSeconds(.1); }
/// <summary> /// Activates the loading screen. /// </summary> public static void Load(ScreenManager screenManager, bool loadingIsSlow, PlayerIndex? controllingPlayer, params GameScreen[] screensToLoad) { // Tell all the current screens to transition off. foreach (GameScreen screen in screenManager.GetScreens()) screen.ExitScreen(); // Create and activate the loading screen. LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad); screenManager.AddScreen(loadingScreen, controllingPlayer); }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); Camera2D.BaseScreenSize = new Vector2(800, 600); //Settings = Settings.Load(); //ScoreData = ScoreData.Load(); #if WINDOWS graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; //graphics.IsFullScreen = Settings.IsFullScreen; //graphics.PreferredBackBufferWidth = Settings.Resolutions[Settings.CurrentResolution].X; //graphics.PreferredBackBufferHeight = Settings.Resolutions[Settings.CurrentResolution].Y; #endif #if WINDOWS_PHONE TargetElapsedTime = TimeSpan.FromTicks(333333); graphics.PreferredBackBufferWidth = 640; graphics.PreferredBackBufferHeight = 480; graphics.IsFullScreen = true; #endif Camera2D.ResolutionScale = (float)graphics.PreferredBackBufferWidth / Camera2D.BaseScreenSize.X; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); #if DEBUG Components.Add(new DebugComponent(this)); // TEST LEVELS LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else LoadingScreen.Load(screenManager, false, null, new QuickMenuScreen()); //LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }
/// <summary> /// The main game constructor. /// </summary> public GameStateManagementGame() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = graphics.PreferredBackBufferHeight = 480; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); // Activate the first screens. screenManager.AddScreen(new BackgroundScreen(), null); screenManager.AddScreen(new MainMenuScreen(), null); }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 375; graphics.PreferredBackBufferHeight = 600; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); LoadingScreen.Load(screenManager, true, null, new IntroScreen("intro")); // TEST LEVELS //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); Camera2D.BaseScreenSize = new Vector2(800, 600); #if WINDOWS graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; #endif #if WINDOWS_PHONE //TargetElapsedTime = TimeSpan.FromTicks(333333); graphics.PreferredBackBufferWidth = 640; graphics.PreferredBackBufferHeight = 480; #endif Camera2D.PhoneScale = Math.Min((float)graphics.PreferredBackBufferWidth / Camera2D.BaseScreenSize.X, (float)graphics.PreferredBackBufferHeight / Camera2D.BaseScreenSize.Y); IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); #if DEBUG && WINDOWS Components.Add(new DebugComponent(this)); // TEST LEVELS LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else graphics.IsFullScreen = true; //LoadingScreen.Load(screenManager, true, null, new QuickMenuScreen()); LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }
public Level(ScreenManager screenManager, int levelIndex) { this.gameContent = screenManager.GameContent; this.levelIndex = levelIndex; LevelDetails ld = gameContent.content.Load<LevelDetails>("Levels/level" + levelIndex.ToString("00")); Vector2 castlePos = new Vector2(1.5f, 6.5f) * Tile.Width; armyPosition.Add(castlePos); castles[(int)Shape.square] = new Castle(gameContent, Shape.square, castlePos); castles[(int)Shape.triangle] = new Castle(gameContent, Shape.triangle, new Vector2(800, 600) - castlePos); for (int i = 0; i < ld.ArmyNumber.Count; i++) for (int j = 0; j < ld.ArmyNumber[i]; j++) { Vector2 v = GetPosition(); armies.Add(new Army(gameContent, Shape.square, (Rank)i, v)); armies.Add(new Army(gameContent, Shape.triangle, (Rank)i, new Vector2(800, 600) - v)); } enemyWaitTime = 0; MaxEnemyWaitTime = MaxEnemyWaitTime / (float)Math.Pow(10, ld.GameMode); }
public Level(ScreenManager screenManager, int levelIndex) { this.gameContent = screenManager.GameContent; this.levelIndex = levelIndex; camera = new Camera2D(); groundBody = world.CreateBody(new BodyDef()); LoadTiles(levelIndex); UpdateCameraChaseTarget(new GameTime()); Vector2[] v = {Vector2.Zero, new Vector2(tiles.GetLength(0), 0), new Vector2(tiles.GetLength(0), tiles.GetLength(1)), new Vector2(0, tiles.GetLength(1)), Vector2.Zero}; for (int i = 0; i < v.Length - 1; i++) { PolygonShape ps = new PolygonShape(); ps.SetAsEdge(v[i] * Tile.Width / gameContent.b2Scale, v[i + 1] * Tile.Width / gameContent.b2Scale); groundBody.CreateFixture(ps, 0); } }