示例#1
0
 public SparkGameView(SpriteBatch spriteBatch, Texture2D texture, Camera camera)
 {
     this.spriteBatch = spriteBatch;
     this.texture = texture;
     this.cam = camera;
     splitterSystem = new SplitterSystem(modelStartPosition);
 }
示例#2
0
 public SmokeGameView(SpriteBatch spriteBatch, Texture2D texture, Camera camera)
 {
     this.spriteBatch = spriteBatch;
     this.texture = texture;
     this.cam = camera;
     smokeSystem = new SmokeSystem(modelStartPosition);
 }
示例#3
0
 public void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
 {
     for (int i = 0; i < MAX_PARTICLES; i++)
     {
         particles[i].Draw(spriteBatch, camera, texture);
     }
 }
示例#4
0
 public void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
 {
     for (int i = 0; i < MAX_SMOKE; i++)
     {
         smokeClouds[i].Draw(spriteBatch, camera, texture);
     }
 }
示例#5
0
 public void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
 {
     for (int i = 0; i < MAX_WAVE; i++)
     {
         shockwaves[i].Draw(spriteBatch, camera, texture);
     }
 }
示例#6
0
文件: Smoke.cs 项目: shjelm/1DV437
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            Vector2 viewPosition = camera.GetVisualPositions(position);

            Vector2 visualRadius = camera.GetVisualPositions(smokeSize);

            Rectangle rect = new Rectangle((int)viewPosition.X, (int)viewPosition.Y, (int)visualRadius.X, (int)visualRadius.Y);

            Color color = new Color(visibility, visibility, visibility, visibility);

            spriteBatch.Draw(texture, viewPosition, null, color, rotation, new Vector2(origin, origin), size, SpriteEffects.None, 0);
        }
示例#7
0
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            viewPosition = camera.GetVisualPositions(pos);
            Console.WriteLine(size);

            Vector2 visualSize = camera.GetVisualPositions(new Vector2(size,size));

            Rectangle rect = new Rectangle((int)viewPosition.X - (int)visualSize.X / 2, (int)viewPosition.Y - (int)visualSize.Y / 2, (int)visualSize.X, (int)visualSize.Y);

            Color color = new Color(visibility, visibility, visibility, visibility);

            spriteBatch.Draw(texture, rect, color);
        }
示例#8
0
        internal void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
        {
            Vector2 viewPosition = camera.GetVisualPositions(position);

            Vector2 visualRadius = camera.GetVisualPositions(radius);

            Rectangle rect = new Rectangle((int)viewPosition.X, (int)viewPosition.Y, (int)visualRadius.X, (int)visualRadius.Y);

            float t = timeLivedSeconds/maxLifeTime;
            if (t > 1.0)
            {
                t = 1.0f;
            }
            float endValue = 0.0f;
            float startValue = 1.0f;
            float visibility = endValue * t + (1.0f - t) * startValue;

            Color color = new Color(visibility, visibility, visibility, visibility);

            spriteBatch.Draw(texture, rect, color);
        }
示例#9
0
文件: Game1.cs 项目: shjelm/1DV437
        /// <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);
            sparkTexture = Content.Load<Texture2D>("spark");
            smokeTexture = Content.Load<Texture2D>("particlesmoke");
            swTexture = Content.Load<Texture2D>("shockwave");

            cam = new View.Camera(400, 400);

            sparkView = new View.SparkGameView(spriteBatch, sparkTexture, cam);
            smokeView = new View.SmokeGameView(spriteBatch, smokeTexture, cam);
            swView = new View.SwGameView(spriteBatch, swTexture, cam);

            // TODO: use this.Content to load your game content here
        }