/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); this.Services.AddService(typeof(SpriteBatch), spriteBatch); DiagnosticsManager.Initialize(this); SpriteBatchHelpers.Initialize(GraphicsDevice); Primitives.Initialize(GraphicsDevice); Billboard.Initialize(GraphicsDevice, Content.Load <Effect>("Shaders/Billboarding")); // TODO: use this.Content to load your game content here CreateSpheres(); ship = new Ship(this); followCam = new FollowCamera(camera, ship); lightningTexture = new LightningTexture(GraphicsDevice, 50, 100); #region Particles pSet = new ParticleSettings() { BlendState = BlendState.Additive, MaxParticles = 10, Duration = TimeSpan.FromSeconds(0.5), DurationRandomness = 0.1f, EmitterVelocitySensitivity = 0, MinVelocity = 1f, MaxVelocity = 2f, Gravity = Vector3.Zero, EndVelocity = 0, MinColor = Color.White, MaxColor = Color.White, MinRotateSpeed = -0.1f, MaxRotateSpeed = 0.1f, MinStartSize = 0.25f, MaxStartSize = 0.35f, MinEndSize = 0.5f, MaxEndSize = 0.6f }; var pTex = new Texture2D(GraphicsDevice, 5, 5); pTex.SetData(Enumerable.Repeat(Color.FromNonPremultiplied(0, 0, 255, 125), 25).ToArray()); var pEff = Content.Load <Effect>("Shaders/Particles"); pSys = new ParticleSystem(this, pSet, pTex, pEff, camera); pEmi = new ParticleEmitter(pSys) { Position = Vector3.UnitX, ParticlesPerSecond = 10 }; pEmi2 = new ParticleEmitter(pSys) { Position = -Vector3.UnitX, ParticlesPerSecond = 10 }; //pEmi = new ParticleEmitter(pSys) { Position = Vector3.UnitY, ParticlesPerSecond = 10 }; //pEmi = new ParticleEmitter(pSys) { Position = new Vector3(Vector2.One, 0), ParticlesPerSecond = 10 }; #endregion base.LoadContent(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); this.Services.AddService(typeof(SpriteBatch), spriteBatch); DiagnosticsManager.Initialize(this); SpriteBatchHelpers.Initialize(GraphicsDevice); Primitives.Initialize(GraphicsDevice); Renderer = new Engine.Graphics.Renderer() { Camera = new PerspectiveCamera() { Position = Vector3.UnitX, Target = Vector3.Zero, Up = Vector3.Up, FieldOfView = MathHelper.PiOver4, AspectRatio = GraphicsDevice.Viewport.AspectRatio, NearPlane = 0.01f, FarPlane = 5000f } }; // TODO: use this.Content to load your game content here // TODO: load assets (player string font and player model) World = new World(this, Renderer); var player = World.SpawnPlayer("Player1"); var playerTrans = World.Transformations[player]; playerTrans.Scale = new Vector3(2); // TODO: load world state from data files base.LoadContent(); }