Esempio n. 1
0
        public Particle(Vector2 startingPosition, float rotation, ParticleType particleType)
        {
            _position     = startingPosition;
            _rotation     = rotation;
            _particleType = particleType;
            _fadeOutTimer = new Timer(particleType.Lifespan);

            if (particleType.SpriteAnimationSequence != null)
            {
                _sprite = new AnimatedSprite(particleType.SpriteAnimationSequence, particleType.EntitySize, particleType.AnimationDuration, particleType.DrawLayer, false);
            }

            if (particleType.GlowSpriteAnimationSequence != null)
            {
                GlowSprite = new AnimatedSprite(particleType.GlowSpriteAnimationSequence, particleType.EntitySize, particleType.AnimationDuration, particleType.DrawLayer, false);
            }
        }
Esempio n. 2
0
        /// <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.StartNewGame will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _hudManager.Initialize();

            //set up the black pixel used for clearing the screen
            _blackPx = new Texture2D(_graphics.GraphicsDevice, 1, 1);
            uint[] px = { 0xFFFFFFFF };
            _blackPx.SetData <uint>(px);

            InputManager.Initialize();

            SoundEffectManager.Initilize();

            //initial menu music
            _backgroundMusic = new MusicController();
            _backgroundMusic.Enqueue("Predatory Instincts_ElevatorRemix");
            _backgroundMusic.Play();

            PainStaticMaker.Initialize();

            _mouseDrawer.Initialize();

            CharacterType.Initialize();
            ParticleType.Initialize();

            LoseScreen.Initialize();

            GameState.Initilize();
            StartNewGame();

            _shiftInterface.Initialize(_spriteBatch);

            base.Initialize();
        }