コード例 #1
0
ファイル: Game1.cs プロジェクト: ms223uh/1DV437-2-
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(this.GraphicsDevice);
            smokeTexture = this.Content.Load<Texture2D>("smokePic");
            particleSystem = new ParticleSystem(new Vector2(250, 210)); // // Cordination of smokeSpawn - Position
            particleSystem.addParticle(new Vector2(0.02f, 0.015f), // density
                                        new Vector2(1, -1), new Vector2(0.1f * MathHelper.Pi, 0.25f * -MathHelper.Pi), // rotate
                                        new Vector2(0.5f, 0.75f),
                                        new Vector2(20, 120), new Vector2(225, 575f), // spread
                                        Color.Orange, Color.Black, new Color(Color.Black, 0), new Color(Color.Black, 0),
                                        new Vector2(800, 600), new Vector2(100, 160), 10000, Vector2.Zero, smokeTexture);

            base.Initialize();
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: ms223uh/1DV437
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(this.GraphicsDevice);
            smokeTexture = this.Content.Load<Texture2D>("smokePic");
            particleSystem = new ParticleSystem(new Vector2(400, 300));
            particleSystem.addParticle(new Vector2(0.01f, 0.015f),
                                        new Vector2(0, -1), new Vector2(0.1f * MathHelper.Pi, 0.1f * -MathHelper.Pi),
                                        new Vector2(0.5f, 0.75f),
                                        new Vector2(60, 70), new Vector2(15, 15f),
                                        Color.Orange, Color.Black, new Color(Color.Black, 0), new Color(Color.Black, 0),
                                        new Vector2(400, 500), new Vector2(100, 120), 1000, Vector2.Zero, smokeTexture);

            base.Initialize();
        }