コード例 #1
0
        //Die Methode mit dem ein Objekt vom Typ Spieler initialisiert wird und dessen Startwerte eingestellt werden
        public void Initialize(float f_xStartPosition, float f_yStartPosition, float f_xStartVelocity, float f_yStartVelocity, float speed, short health, Animation startAnimation, int screenWidth, ScreenManager screenmanager)
        {
            base.Initialize(f_xStartPosition, f_yStartPosition, f_xStartVelocity, f_yStartVelocity, speed, health, startAnimation, screenWidth);
            m_mouth = new Mouth();
            m_mouth.Initialize(screenmanager.imageFileSystem.mouth, 48, 50);


            m_playerIsJumping   = false;
            m_playerStartedJump = false;
            m_playerJumpHeight  = 250;
            m_jumpWuhu          = screenmanager.audioFileSystem.wuhu;


            screenManager = screenmanager;
            m_movefloor   = false;

            m_projectileList = new List <Projectile>();

            m_canShoot = true;
            m_lastShot = 0;
            m_playerAnimationMirror = SpriteEffects.None;


            m_score            = 0;
            m_currenProjectile = 0;
            m_shootVector      = new Vector2();

            leftCollision = rightCollision = false;

            initializeProjectiles(150, new Vector2(1, 1));
            m_active = true;

            #region Ermitter
            m_ermitterSettings         = new ParticleSystemSettings();
            m_ermitterSettings.IsBurst = false;
            m_ermitterSettings.SetLifeTimes(0.5f, 1.0f);
            m_ermitterSettings.SetScales(0.1f, 0.6f);
            m_ermitterSettings.ParticlesPerSecond   = 15.0f;
            m_ermitterSettings.InitialParticleCount = (int)(m_ermitterSettings.ParticlesPerSecond * m_ermitterSettings.MaximumLifeTime);
            m_ermitterSettings.SetDirectionAngles(0, 180);
            m_ermitterSettings.color = Color.White;
            m_ermitter = new ParticleEmitter.ParticleSystem(screenmanager.Game, m_ermitterSettings, screenmanager.imageFileSystem.DustParticle);
            m_ermitter.OriginPosition    = f_Position;
            m_ermitterSettings.emitterOn = false;
            #endregion
        }
コード例 #2
0
        public void Initialize(Texture2D texture, int x_Start, int y_Start, ScreenManager screenmanager)
        {
            f_position   = new Vector2(x_Start, y_Start);
            this.y_Start = y_Start;
            m_texture    = texture;
            x_speed      = 10;
            y_speed      = 2;

            #region Ermitter
            m_ermitterSettings = new ParticleSystemSettings();
            m_ermitterSettings.ParticleTextureFileName = "ParticleStar";
            m_ermitterSettings.IsBurst = false;
            m_ermitterSettings.SetLifeTimes(1.0f, 3.5f);
            m_ermitterSettings.SetScales(0.1f, 0.8f);
            m_ermitterSettings.ParticlesPerSecond   = 200.0f;
            m_ermitterSettings.InitialParticleCount = (int)(m_ermitterSettings.ParticlesPerSecond * m_ermitterSettings.MaximumLifeTime);
            m_ermitterSettings.SetDirectionAngles(0, 360);
            m_ermitterSettings.emitterOn = true;
            m_ermitterSettings.color     = Color.White;

            m_ermitter = new ParticleEmitter.ParticleSystem(screenmanager.Game, m_ermitterSettings, screenmanager.imageFileSystem.smokeParticle);
            m_ermitter.OriginPosition = f_position;
            #endregion
        }
コード例 #3
0
        public LevelWonScreen(ScreenManager manager, Helper h, bool b)
        {
            screenManager        = manager;
            helper               = h;
            listOfTouchLocations = new List <TouchLocation>();
            b_touchState         = b;
            myTick               = 0;

            #region Ermitter

            m_ermitterSettings         = new ParticleSystemSettings();
            m_ermitterSettings.IsBurst = false;
            m_ermitterSettings.color   = Color.Red;
            m_ermitterSettings.SetLifeTimes(5f, 10.0f);
            m_ermitterSettings.SetScales(1.0f, 1.5f);
            m_ermitterSettings.ParticlesPerSecond   = 1000.0f;
            m_ermitterSettings.InitialParticleCount = (int)(m_ermitterSettings.ParticlesPerSecond * m_ermitterSettings.MaximumLifeTime);
            m_ermitterSettings.SetDirectionAngles(0, 360);
            m_ermitterSettings.SetSpeeds(200, 800);
            m_ermitter = new ParticleEmitter.ParticleSystem(screenManager.Game, m_ermitterSettings, screenManager.imageFileSystem.redPixel);
            m_ermitter.OriginPosition    = new Vector2(UIConstants.screenWidth / 2, UIConstants.screenHeight / 2);
            m_ermitterSettings.emitterOn = true;
            #endregion
        }
コード例 #4
0
        public override void Initialize()
        {
            ParticleSystemSettings settings = new ParticleSystemSettings();
            settings.ParticleTextureFileName = "ParticleStar";
            settings.IsBurst = false;
            settings.SetLifeTimes(0.5f, 1f);
            settings.SetScales(0.1f, 0.4f);
            settings.ParticlesPerSecond = 50.0f;
            settings.InitialParticleCount = (int)(settings.ParticlesPerSecond * settings.MaximumLifeTime);
            settings.SetDirectionAngles(0, 360);

            emitter = new ParticleEmitter.ParticleSystem(game, settings);
            emitter.Initialize();

            base.Initialize();
        }