public Particle(int lifespan, TexturedQuad texQuad, GraphicsDevice graphicsDevice) { textureQuad = texQuad; Lifespan = lifespan; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { floor = new TexturedQuad(graphics.GraphicsDevice, Content.Load<Texture2D>(@"stone"), new Vector3(-64, 0, 64), new Vector3(64, 0, 64), new Vector3(-64, 0, -64), new Vector3(64, 0, -64)); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); basicEffect = new BasicEffect(GraphicsDevice); List<Texture2D> textures = new List<Texture2D> { Content.Load<Texture2D>("fire") }; particleEffect.LoadContent(textures, GraphicsDevice); camera = new Camera(GraphicsDevice.Viewport, Vector3.Zero, Vector3.Up); VertexPositionColor[] vertices = new VertexPositionColor[3]; vertices[0] = new VertexPositionColor(new Vector3(0, 1, 0), Color.Red); vertices[1] = new VertexPositionColor(new Vector3(+0.5f, 0, 0), Color.Red); vertices[2] = new VertexPositionColor(new Vector3(-0.5f, 0, 0), Color.Red); debugFont = Content.Load<SpriteFont>(@"SpriteFont1"); vertexBuffer = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColor), 3, BufferUsage.WriteOnly); vertexBuffer.SetData<VertexPositionColor>(vertices); // TODO: use this.Content to load your game content here }