// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // World Parallax Production Here // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// <summary> /// Call to produce all the available preset parallax /// </summary> public static void Create_WorldParallax() { // --------------------- #region Main Menu WorldParallax Menu = new WorldParallax(); ParallaxImage menu_sky = new ParallaxImage ( Shared.IMG_Parallax["sky"], Vector2.Zero, 0f ); ParallaxImage menu_mountains = new ParallaxImage ( Shared.IMG_Interface["MenuMountains"], new Vector2(-100, -50), 0.1f, autoscroll: true, autoscroll_speed: -0.4f, camera_affected: false ); ParallaxImage menu_clouds3 = new ParallaxImage ( Shared.IMG_Parallax["clouds2"], new Vector2(0, 0), 0.1f, 0.5f, autoscroll: true, autoscroll_speed: -0.75f ); ParallaxImage menu_clouds2 = new ParallaxImage ( Shared.IMG_Parallax["clouds2"], new Vector2(0, -20), 0.1f, 0.5f, autoscroll: true, autoscroll_speed: -1f ); ParallaxImage menu_clouds1 = new ParallaxImage ( Shared.IMG_Parallax["clouds1"], new Vector2(100, 0), 0.2f, 0.5f, autoscroll: true, autoscroll_speed: -1.5f ); Menu.Parallax_images.Add(menu_sky); Menu.Parallax_images.Add(menu_clouds3); Menu.Parallax_images.Add(menu_mountains); Menu.Parallax_images.Add(menu_clouds2); Menu.Parallax_images.Add(menu_clouds1); Shared.World_Parallax.Add("Menu", Menu); #endregion // --------------------- // --------------------- #region The Overworld WorldParallax Overworld = new WorldParallax(); ParallaxImage sky = new ParallaxImage ( Shared.IMG_Parallax["sky"], Vector2.Zero, 0f ); ParallaxImage mountains = new ParallaxImage ( Shared.IMG_Parallax["far_mountains"], new Vector2(0, -180), 0.2f ); ParallaxImage hills = new ParallaxImage ( Shared.IMG_Parallax["hills"], new Vector2(100, -550), 0.5f ); ParallaxImage clouds2 = new ParallaxImage ( Shared.IMG_Parallax["clouds2"], new Vector2(0, -50), 0.1f, autoscroll: true, autoscroll_speed: 0.5f ); ParallaxImage clouds1 = new ParallaxImage ( Shared.IMG_Parallax["clouds1"], new Vector2(0, -150), 0.2f, autoscroll: true, autoscroll_speed: 1f ); Overworld.Parallax_images.Add(sky); Overworld.Parallax_images.Add(clouds2); Overworld.Parallax_images.Add(mountains); Overworld.Parallax_images.Add(hills); Overworld.Parallax_images.Add(clouds1); Shared.World_Parallax.Add("Overworld", Overworld); #endregion // --------------------- }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // --------- Defaults ------------- spriteBatch = new SpriteBatch(GraphicsDevice); // --------- Store Globals ------------- Shared.Batch = spriteBatch; Shared.Main = this; // --------- Load Assets ------------- Shared.IMG_Interface = AssetLoader.LoadContent <Texture2D>(Content, "Images/Interface"); Shared.IMG_Items = AssetLoader.LoadContent <Texture2D>(Content, "Images/Items"); Shared.IMG_Sprites = AssetLoader.LoadContent <Texture2D>(Content, "Images/Sprites"); Shared.IMG_Worlds = AssetLoader.LoadContent <Texture2D>(Content, "Images/Worlds"); Shared.SFX_Sounds = AssetLoader.LoadContent <SoundEffect>(Content, "Audio/SFX"); Shared.AUDIO_Music = AssetLoader.LoadContent <Song>(Content, "Audio/Music"); // --------- Load & Generate Particles & Effects ------------- Shared.IMG_Animations = AssetLoader.LoadContent <Texture2D>(Content, "Images/Effects/Animations"); Shared.IMG_Emotes = AssetLoader.LoadContent <Texture2D>(Content, "Images/Effects/Emotes"); Shared.IMG_Projectiles = AssetLoader.LoadContent <Texture2D>(Content, "Images/Effects/Projectiles"); Particles.Generate_Effects(); // --------- Build Tilesheets ------------- Shared.IMG_Tiles = AssetLoader.LoadContent <Texture2D>(Content, "Images/Objects/Tiles"); Shared.Tileset = new Dictionary <string, Tileset>(); Terrain.Generate_Tiles(Shared.IMG_Tiles); // --------- Build Parallaxs -------- Shared.IMG_Parallax = AssetLoader.LoadContent <Texture2D>(Content, "Images/Parallax"); Shared.World_Parallax = new Dictionary <string, WorldParallax>(); WorldParallax.Create_WorldParallax(); // --------- Debug Data ------------- Shared.Pixel = new Texture2D(Shared.Main.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); Shared.Pixel.SetData(new[] { Color.White }); SpriteFont font = Content.Load <SpriteFont>("Fonts/Pigsfont"); Shared.DebugWindow = new BasicText(font, new Vector2(0, 100), "Test", Color.Lime); // --------- Set Up Menu Animation ------------- MediaPlayer.Play(Shared.AUDIO_Music["Menu"]); MediaPlayer.IsRepeating = true; MediaPlayer.Volume = 1f; Menu_Animation.Add(Shared.IMG_Interface["MenuSceneF1"]); Menu_Animation.Add(Shared.IMG_Interface["MenuSceneF2"]); Menu_Animation.Add(Shared.IMG_Interface["MenuSceneF3"]); Menu_Animation.Add(Shared.IMG_Interface["MenuSceneF4"]); // --------- Scene Creation ------------- // Menu Display ------------------------- Title = Shared.IMG_Interface["TitleBar"]; Menu_Parallax = Shared.World_Parallax["Menu"]; // -------------------------------------- mainMenu = new MainMenu(); Shared.MainMenu = mainMenu; Components.Add(mainMenu); playScene = new PlayScene(); Components.Add(playScene); deadScene = new DeadScene(); Shared.DeadScene = deadScene; Components.Add(deadScene); controlScene = new ControlsScene(); Components.Add(controlScene); aboutScene = new AboutScene(); Components.Add(aboutScene); creditScene = new CreditScene(); Components.Add(creditScene); splashscreen = new Splashscreen(); Components.Add(splashscreen); HideAllScenes(); splashscreen.Show(); // ----------------------------------------- }