コード例 #1
0
        /// <summary>
        /// Instantiates the default particle effect.
        /// </summary>
        private ParticleEffect InstantiateDefaultParticleEffect()
        {
            Trace.WriteLine("Instantiating default particle effect...", "CORE");

            ParticleEffect effect = new ParticleEffect
            {
                new Emitter
                {
                    Budget  = 5000,
                    Enabled = true,
                    MinimumTriggerPeriod = 0f,
                    Name                     = "Basic Emitter",
                    ParticleTexture          = this.DefaultParticleTexture,
                    ParticleTextureAssetName = "FlowerBurst",
                    ReleaseColour            = Color.White.ToVector3(),
                    ReleaseOpacity           = 1f,
                    ReleaseQuantity          = 10,
                    ReleaseScale             = new VariableFloat {
                        Value = 32f, Variation = 16f
                    },
                    ReleaseSpeed = new VariableFloat {
                        Value = 25f, Variation = 25f
                    },
                    Term      = 1f,
                    Modifiers = new ModifierCollection(),
                },
            };

            effect.Initialise();

            return(effect);
        }
コード例 #2
0
        /// <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);

            // TODO: use this.Content to load your game content here
            _scoreFont    = Content.Load <SpriteFont>("scoreFont");
            _countInFont  = Content.Load <SpriteFont>("countInFont");
            _winningFont  = Content.Load <SpriteFont>("winningFont");
            _menuChange   = Content.Load <SoundEffect>("menuChange");
            _menuSelect   = Content.Load <SoundEffect>("menuSelect");
            _paddleHit    = Content.Load <SoundEffect>("paddleHit");
            _pointScored  = Content.Load <SoundEffect>("pointScored");
            _male3        = Content.Load <SoundEffect>("male3");
            _male2        = Content.Load <SoundEffect>("male2");
            _male1        = Content.Load <SoundEffect>("male1");
            _winningSound = Content.Load <SoundEffect>("winning");
            _powerUpSound = Content.Load <SoundEffect>("powerUp");
            _boing        = Content.Load <SoundEffect>("boing");

            _blueSunEffect = Content.Load <ParticleEffect>("BlueSun");
            _blueSunEffect.LoadContent(Content);
            _blueSunEffect.Initialise();

            _pinkSunEffect = Content.Load <ParticleEffect>("Sun");
            _pinkSunEffect.LoadContent(Content);
            _pinkSunEffect.Initialise();

            _backgroundEffect = Content.Load <ParticleEffect>("trail");
            _backgroundEffect.LoadContent(Content);
            _backgroundEffect.Initialise();

            _trailEffect = Content.Load <ParticleEffect>("fireball5");
            _trailEffect.LoadContent(Content);
            _trailEffect.Initialise();

            _leftPaddleEffect = Content.Load <ParticleEffect>("red_smoke");
            _leftPaddleEffect.LoadContent(Content);
            _leftPaddleEffect.Initialise();

            _rightPaddleEffect = Content.Load <ParticleEffect>("blue_smoke");
            _rightPaddleEffect.LoadContent(Content);
            _rightPaddleEffect.Initialise();

            _backgroundMusic = Content.Load <Song>("inception");

            _myRenderer.LoadContent(Content);

            if (MediaPlayer.State == MediaState.Stopped)
            {
                MediaPlayer.Play(_backgroundMusic);
                MediaPlayer.Volume      = 0.4f;
                MediaPlayer.IsRepeating = true;
            }
            else if (MediaPlayer.State == MediaState.Paused)
            {
                MediaPlayer.Resume();
            }
        }
コード例 #3
0
ファイル: ParticleEntity.cs プロジェクト: jwmcglynn/float
        public ParticleEntity(GameEnvironment env, string effectName)
        {
            Environment = env;

            Effect = Environment.contentManager.Load <ParticleEffect>(effectName).DeepCopy();
            Effect.Initialise();
            Effect.LoadContent(Environment.contentManager);
        }
コード例 #4
0
 public void LoadContentInEditor(ContentManager content)
 {
     _content       = content;
     particleEffect = ParticleManager.getParticleEffect(particleType);
     if (particleEffect != null)
     {
         particleEffect.LoadContent(content);
         particleEffect.Initialise();
     }
 }
コード例 #5
0
        public void LoadContent(ContentManager content)
        {
            flameEffect = content.Load <ParticleEffect>("Particles\\flameEffect");
            flameEffect.LoadContent(content);
            flameEffect.Initialise();
            explosionEffect = content.Load <ParticleEffect>("Particles\\explosionEffect");
            explosionEffect.LoadContent(content);
            explosionEffect.Initialise();

            particleRenderer.LoadContent(content);
        }
コード例 #6
0
        protected override void Initialize()
        {
            kinectRuntime = new Runtime();
            kinectRuntime.Initialize(RuntimeOptions.UseColor | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseDepthAndPlayerIndex);
            kinectRuntime.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

            kinectRuntime.VideoFrameReady    += VideoFrameReady;
            kinectRuntime.SkeletonFrameReady += SkeletonFrameReady;

            particleEffect.Initialise();

            base.Initialize();
        }
コード例 #7
0
        public ParticleEffectComponent(Engine engine, string effectName, Vector2 initialPosition)
            : base(engine)
        {
            DrawParticleEffect = true;
            particleEffectName = effectName;
            this.Position      = initialPosition;

            particleEffect = Engine.Content.Load <ParticleEffect>(@"ParticleEffects\" + particleEffectName);
            particleEffect.LoadContent(Engine.Content);
            particleEffect.Initialise();

            DrawOrder = int.MaxValue - 1;

            Engine.AddComponent(this);
        }
コード例 #8
0
 private void Reload()
 {
     if (_content != null)
     {
         particleEffect = ParticleManager.getParticleEffect(particleType);
         if (particleEffect != null)
         {
             particleEffect.LoadContent(_content);
             particleEffect.Initialise();
             layer.particleRenderer.removeParticleObjectsInEditor(this);
             layer.particleRenderer.addParticleObjectsInEditor(this, _content);
             layer.particleRenderer.particleRenderer.LoadContent(_content);
         }
     }
 }
コード例 #9
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Ressource.LoadContent(Content);

            score = new Hud(new TimeSpan(0, 0, 50), new Vector2(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height));

            //particules
            particleRenderer.LoadContent(Content);
            particleEffect = Ressource.BeamMeUp;
            particleEffect.LoadContent(Content);
            particleEffect.Initialise();

            // VIDEO DISPLAY

            vidRectangle = new Rectangle(GraphicsDevice.Viewport.X, GraphicsDevice.Viewport.Y,
                                         GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            if (!vidHasBeenPlayed)
            {
                VidPlayer.Play(Ressource.vid);
                vidHasBeenPlayed = true;
            }


            //MENU GENERATION
            menu = menu.ChangeMenu(Menu.MenuType.welcome);


            // MAP GENERARATION
            Tile.Content = Content;
            camera       = new Camera(GraphicsDevice.Viewport);

            if (Ressource.parameter[0])
            {
                MediaPlayer.Play(Ressource.song);
                MediaPlayer.Volume = 0.1f;
            }
            else
            {
                MediaPlayer.Stop();
            }
        }
コード例 #10
0
        private void AddParticleEffect(ParticleEffect particleEffect, ICollidableTile trackingObject)
        {
            particleEffect.LoadContent(m_game.Content);

            particleEffect.Initialise();

            var entry = new LightCausingParticleObject(particleEffect, m_particleRenderer,
                                                       new PointLight()
            {
                Colour         = Color.Orange,
                LightIntensity = 4,
                LightRadius    = 25,
                LightPosition  = new Vector3(300, 160, -100)
            }, trackingObject)
            {
                Name    = "FlameThrower",
                Enabled = false
            };

            ParticleEffects.Add(entry);
        }
コード例 #11
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                {
                    content = new ContentManager(ScreenManager.Game.Services, "Content");
                }

                kinectRGBVideo.Texture = new Texture2D(ScreenManager.GraphicsDevice, 640, 480, false, SurfaceFormat.Color);

                kinectRuntime = new Runtime();
                kinectRuntime.Initialize(RuntimeOptions.UseColor | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseDepthAndPlayerIndex);
                kinectRuntime.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

                kinectRuntime.VideoFrameReady    += VideoFrameReady;
                kinectRuntime.SkeletonFrameReady += SkeletonFrameReady;

                kinectRGBVideo.Position = new Vector2(183, 225);
                UI_KinectFrameOffset    = new Vector2(183, 225);

                // Game Set inits.
                //Game Level is initiated which has all the number of sets game and instruction
                gameLevelManager = new GameLevelManager(this.currentLevel, ref content);
                generateGameSet();

                // Load sounds
                correct_snd = new GameSFX(content.Load <SoundEffect>("kling"));

                //Loads the background music and plays it
                GameMusic background = new GameMusic(content.Load <Song>("background_music3"));
                background.PlayLooping();

                particleEffect   = new ParticleEffect();
                particleRenderer = new SpriteBatchRenderer
                {
                    GraphicsDeviceService = (IGraphicsDeviceService)ScreenManager.Game.Services.GetService(typeof(IGraphicsDeviceService))
                };
                particleRenderer.LoadContent(content);
                particleEffect = content.Load <ParticleEffect>(("BasicExplosion"));
                particleEffect.LoadContent(content);
                particleEffect.Initialise();

                //Interface Layer
                UI_FrameLayer               = content.Load <Texture2D>("frame");
                UI_FrameLayerPosition       = new Vector2(0, 0);
                UI_Font_Instruction         = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Instruction = new Vector2(500, 90);
                UI_Font_Score               = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Score       = new Vector2(500, 22);
                UI_Font_Level               = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Level       = new Vector2(80, 22);
                UI_Font_Time         = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Time = new Vector2(850, 22);

                //Interactive Elements
                textAnim_GoodJob  = new TextAnimator(content.Load <SpriteFont>("SpriteFont"));
                textAnim_GameOver = new TextAnimator(content.Load <SpriteFont>("SpriteFont"));

                // once the load has finished, we use ResetElapsedTime to tell the game's
                // timing mechanism that we have just finished a very long frame, and that
                // it should not try to catch up.
                ScreenManager.Game.ResetElapsedTime();

                // Debugger
                if (debuggerOn)
                {
                    skeletonDebugger = new SkeletonOverlayDebugger(kinectRuntime);
                    shapeDebugger.init(ScreenManager.GraphicsDevice);
                }
            }
        }
コード例 #12
0
        protected override void LoadContent()
        {
            // Rendering inits.
            spriteBatch             = new SpriteBatch(GraphicsDevice);
            kinectRGBVideo.Texture  = new Texture2D(GraphicsDevice, gameWidth, gameHeight, false, SurfaceFormat.Color);
            kinectRGBVideo.Position = new Vector2(183, 225);

            // Game Set inits.
            initGameSetList();
            generateGameSet();

            // Load sounds
            correct_snd = new GameSFX(Content.Load <SoundEffect>("kling"));

            //Loads the background music and plays it
            GameMusic background = new GameMusic(Content.Load <Song>("background_music3"));

            background.PlayLooping();

            particleRenderer.LoadContent(Content);
            particleEffect = Content.Load <ParticleEffect>(("BasicExplosion"));
            particleEffect.LoadContent(Content);
            particleEffect.Initialise();

            //Handling Interface Layer on the screen
            interfacelayer = Content.Load <Texture2D>("frame");
            layerPos       = new Vector2(0, 0);

            //Handling Font Sprite on the screen
            font    = Content.Load <SpriteFont>("SpriteFont");
            fontPos = new Vector2(535, 22);

            /*
             * //skeleton right hand
             * GameTextureInstance texture = GameTextureInstance.CreateBlank(GraphicsDevice, 20, 20);
             * texture.Position = new Vector2(0, 0);
             * texture.Alpha = 1;
             * texture.Color = Color.Orange;
             * skeletonSpots.Add(texture);
             *
             * //Left hand
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, 20, 20);
             * texture.Position = new Vector2(0, 0);
             * texture.Alpha = 1;
             * texture.Color = Color.BlueViolet;
             * skeletonSpots.Add(texture);
             *
             * //hotspots
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(GraphicsDevice.Viewport.Width - texture.Texture.Width - EdgeOffset, EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(10, GraphicsDevice.Viewport.Height - texture.Texture.Height - EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(GraphicsDevice.Viewport.Width - texture.Texture.Width - EdgeOffset, GraphicsDevice.Viewport.Height - texture.Texture.Height - EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * //debug textures
             * GameTextureInstance rectTexture = GameTextureInstance.CreateBlank(GraphicsDevice, 80, 80);
             * rectTexture.Alpha = 0.3f;
             * rectTexture.Color = Color.HotPink;
             * debugSpots.Add(rectTexture);
             *
             * rectTexture = GameTextureInstance.CreateBlank(GraphicsDevice, 80, 80);
             * rectTexture.Alpha = 0.3f;
             * rectTexture.Color = Color.HotPink;
             * debugSpots.Add(rectTexture);
             *
             *
             * ResetSquareColors();
             */
        }
コード例 #13
0
ファイル: Core.cs プロジェクト: Andrea/MercuryParticleEngine
        /// <summary>
        /// Instantiates the default particle effect.
        /// </summary>
        private ParticleEffect InstantiateDefaultParticleEffect()
        {
            ParticleEffect effect = new ParticleEffect
            {
                new Emitter
                {
                    Budget                   = 5000,
                    Enabled                  = true,
                    MinimumTriggerPeriod     = 0f,
                    Name                     = "Basic Emitter",
                    ParticleTexture          = this.DefaultParticleTexture,
                    ParticleTextureAssetName = "FlowerBurst",
                    ReleaseColour            = Color.White.ToVector3(),
                    ReleaseOpacity           = 1f,
                    ReleaseQuantity          = 10,
                    ReleaseScale             = new VariableFloat { Value = 32f, Variation = 16f },
                    ReleaseSpeed             = new VariableFloat { Value = 25f, Variation = 25f },
                    Term                     = 1f,
                    Modifiers                = new ModifierCollection(),
                },
            };

            effect.Initialise();

            return effect;
        }