Пример #1
0
        public override Light DeepCopy()
        {
            var newLight = new PointLight();
            CopyBaseFields(newLight);

            return newLight;
        }
Пример #2
0
 public Bullet(SpriteBatch spriteBatch, Soul game, Vector2 position, Vector2 velocity, string filename, string alias, EntityType type, int damage, int colorType = 0)
     : base(spriteBatch, game, filename, new Vector2(20.0f, 20.0f), alias, type)
 {
     this.position = position;
     this.velocity = velocity;
     this.damage = damage;
     this.hitRadius = Constants.BULLET_RADIUS;
     if (type == EntityType.PLAYER_BULLET)
     {
         pointLight = new PointLight()
         {
             Color = new Vector4(float.Parse(game.lighting.getValue("PlayerBullet", "ColorR")), float.Parse(game.lighting.getValue("PlayerBullet", "ColorG")), float.Parse(game.lighting.getValue("PlayerBullet", "ColorB")), float.Parse(game.lighting.getValue("PlayerBullet", "ColorA"))),
             Power = float.Parse(game.lighting.getValue("PlayerBullet", "Power")),
             LightDecay = int.Parse(game.lighting.getValue("PlayerBullet", "LightDecay")),
             Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("PlayerBullet", "ZPosition"))),
             IsEnabled = true,
             renderSpecular = bool.Parse(game.lighting.getValue("PlayerBullet", "Specular"))
         };
         if (colorType == 1)
         {
             pointLight.Color = new Vector4(float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorR")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorG")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorB")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorA")));
         }
         else if (colorType == 2)
         {
             pointLight.Color = new Vector4(float.Parse(game.lighting.getValue("RapidPowerUp", "ColorR")), float.Parse(game.lighting.getValue("RapidPowerUp", "ColorG")), float.Parse(game.lighting.getValue("RapidPowerUp", "ColorB")), float.Parse(game.lighting.getValue("RapidPowerUp", "ColorA")));
         }
     }
     else if (type == EntityType.DARK_THOUGHT_BULLET)
     {
         pointLight = new PointLight()
         {
             Color = new Vector4(float.Parse(game.lighting.getValue("DarkThoughtBullet", "ColorR")), float.Parse(game.lighting.getValue("DarkThoughtBullet", "ColorG")), float.Parse(game.lighting.getValue("DarkThoughtBullet", "ColorB")), float.Parse(game.lighting.getValue("DarkThoughtBullet", "ColorA"))),
             Power = float.Parse(game.lighting.getValue("DarkThoughtBullet", "Power")),
             LightDecay = int.Parse(game.lighting.getValue("DarkThoughtBullet", "LightDecay")),
             Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("DarkThoughtBullet", "ZPosition"))),
             IsEnabled = true,
             renderSpecular = bool.Parse(game.lighting.getValue("DarkThoughtBullet", "Specular"))
         };
     }
     else if (type == EntityType.BOSS_BULLET)
     {
         pointLight = new PointLight()
         {
             Color = new Vector4(float.Parse(game.lighting.getValue("BossBullet", "ColorR")), float.Parse(game.lighting.getValue("BossBullet", "ColorG")), float.Parse(game.lighting.getValue("BossBullet", "ColorB")), float.Parse(game.lighting.getValue("BossBullet", "ColorA"))),
             Power = float.Parse(game.lighting.getValue("BossBullet", "Power")),
             LightDecay = int.Parse(game.lighting.getValue("BossBullet", "LightDecay")),
             Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("BossBullet", "ZPosition"))),
             IsEnabled = true,
             renderSpecular = bool.Parse(game.lighting.getValue("BossBullet", "Specular"))
         };
     }
 }
Пример #3
0
 public TempLight(Soul game, Vector3 position, float powerScalar, Vector4 colorValue, int lightDecay, float power, bool specular, float minPower, float maxPower)
 {
     this.minPower = minPower;
     this.maxPower = maxPower;
     this.powerScalar = powerScalar;
     pointLight = new PointLight()
     {
         Color = colorValue,
         LightDecay = lightDecay,
         Power = power,
         Position = position,
         IsEnabled = true,
         renderSpecular = specular
     };
 }
Пример #4
0
 public GlowParticle(SpriteBatch spriteBatch, Soul game, string alias, Vector2 position, Vector2 velocity)
     : base(spriteBatch, game, Constants.GLOW_PARTICLE_FILENAME, new Vector2(Constants.GLOW_PARTICLE_DIMENSION), alias, EntityType.DIE_PARTICLE)
 {
     this.velocity = velocity;
     this.position = position;
     pointLight = new PointLight()
     {
         Color = new Vector4(float.Parse(game.lighting.getValue("MainMenuLight", "ColorR")), float.Parse(game.lighting.getValue("MainMenuLight", "ColorG")), float.Parse(game.lighting.getValue("MainMenuLight", "ColorB")), float.Parse(game.lighting.getValue("MainMenuLight", "ColorA"))),
         Power = float.Parse(game.lighting.getValue("MainMenuLight", "Power")),
         LightDecay = int.Parse(game.lighting.getValue("MainMenuLight", "LightDecay")),
         Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("MainMenuLight", "ZPosition"))),
         IsEnabled = true,
         renderSpecular = bool.Parse(game.lighting.getValue("MainMenuLight", "Specular"))
     };
 }
Пример #5
0
        public WeaponPowerupSpread(SpriteBatch spriteBatch, Soul game, string alias, Vector2 position)
            : base(spriteBatch, game, Constants.WEAPON_POWERUP_SPREAD_FILENAME, new Vector2(Constants.WEAPON_POWERUP_SPREAD_DIMENSION), alias, EntityType.WEAPON_POWERUP_SPREAD)
        {
            animation.MaxFrames = 6;
            this.position = position;
            velocity.X = 1.0f;
            this.hitRadius = Constants.WEAPON_POWERUP_SPREAD_RADIUS;

            pointLight = new PointLight()
            {
                Color = new Vector4(float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorR")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorG")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorB")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorA"))),
                Power = float.Parse(game.lighting.getValue("SpreadPowerUp", "Power")),
                LightDecay = int.Parse(game.lighting.getValue("SpreadPowerUp", "LightDecay")),
                Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("SpreadPowerUp", "ZPosition"))),
                IsEnabled = true,
                renderSpecular = bool.Parse(game.lighting.getValue("SpreadPowerUp", "Specular"))
            };
        }
Пример #6
0
        public HealthPowerup(SpriteBatch spriteBatch, Soul game, string alias, Vector2 position)
            : base(spriteBatch, game, Constants.HEALTH_POWERUP_FILENAME, new Vector2(Constants.HEALTH_POWERUP_DIMENSION), alias, EntityType.HEALTH_POWERUP)
        {
            animation.MaxFrames = 8;
            this.position = position;
            velocity.X = 1.0f;
            this.hitRadius = Constants.HEALTH_POWERUP_RADIUS;

            pointLight = new PointLight()
            {
                Color = new Vector4(float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorR")), float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorG")), float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorB")), float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorA"))),
                Power = float.Parse(game.lighting.getValue("HealthLight", "Power")),
                LightDecay = int.Parse(game.lighting.getValue("HealthLight", "LightDecay")),
                Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("HealthLight", "ZPosition"))),
                IsEnabled = true,
                renderSpecular = bool.Parse(game.lighting.getValue("HealthLight", "Specular"))
            };
        }
Пример #7
0
        public GlowParticle(SpriteBatch spriteBatch, Soul game, string alias, Vector2 position, Random random)
            : base(spriteBatch, game, Constants.GLOW_PARTICLE_FILENAME, new Vector2(Constants.GLOW_PARTICLE_DIMENSION), alias, EntityType.DIE_PARTICLE)
        {
            maxVelocity = new Vector2(Constants.GLOW_PARTICLE_MAX_SPEED);
            acceleration = new Vector2(Constants.GLOW_PARTICLE_ACCELERATION);
            this.ghost = true;
            this.position = new Vector2(position.X, position.Y);
            float x = (float)random.Next(-150, 150);
            float y = (float)random.Next(-150, 150);
            this.position.X += x;
            this.position.Y += y;

            if (x > 0.0f)
            {
                velocity.X = NextFloat(random, 0.0f, 1.0f);
            }
            else if (x < 0.0f)
            {
                velocity.X = NextFloat(random, -1.0f, 0.0f);
            }

            if (y > 0.0f)
            {
                velocity.Y = NextFloat(random, 0.0f, 1.0f);
            }
            else if (y < 0.0f)
            {
                velocity.Y = NextFloat(random, -1.0f, 0.0f);
            }

            pointLight = new PointLight()
            {
                Color = new Vector4(0f, 0f, 0f, 1f),
                Power = 1f,
                LightDecay = 90,
                Position = new Vector3(0f, 0f, 50f),
                IsEnabled = true
            };
        }
Пример #8
0
 public PlayerHealthLight(Soul game, int health)
 {
     this.game = game;
     this.flashScalar = int.Parse(game.lighting.getValue("PlayerHealthLight", "FlashScalar"));
     this.maxRadius = int.Parse(game.lighting.getValue("PlayerHealthLight", "MaxRadius"));
     this.minRadius = int.Parse(game.lighting.getValue("PlayerHealthLight", "MinRadius"));
     this.playerMaxHealth = int.Parse(game.constants.getValue("PLAYER", "MAXHEALTH"));
     this.healthColor = new Vector4(float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorR")), float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorG")), float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorB")), float.Parse(game.lighting.getValue("PlayerHealthLight", "ColorA")));
     this.spreadColor = new Vector4(float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorR")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorG")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorB")), float.Parse(game.lighting.getValue("SpreadPowerUp", "ColorA")));
     this.rapidColor = new Vector4(float.Parse(game.lighting.getValue("RapidPowerUp", "ColorR")), float.Parse(game.lighting.getValue("RapidPowerUp", "ColorG")), float.Parse(game.lighting.getValue("RapidPowerUp", "ColorB")), float.Parse(game.lighting.getValue("RapidPowerUp", "ColorA")));
     this.colorScalar = 8;
     this.currentLightRadius = maxRadius;
     this.currentHealth = health;
     pointLight = new PointLight()
     {
         Color = healthColor,
         Power = float.Parse(game.lighting.getValue("PlayerHealthLight", "Power")),
         LightDecay = int.Parse(game.lighting.getValue("PlayerHealthLight", "MaxRadius")),
         Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("PlayerHealthLight", "ZPosition"))),
         IsEnabled = true,
         renderSpecular = bool.Parse(game.lighting.getValue("PlayerHealthLight", "Specular"))
     };
     updateHealthStatus();
 }
Пример #9
0
        private void die()
        {
            waitingToDie = true;
            //dimension.Y = Constants.BOSS_DEATH_HEIGHT;
            //dimension.X = Constants.BOSS_DEATH_WIDTH;
            //sprite = spriteDeath;
            animation.MaxFrames = 0;
            animation.CurrentFrame = 0;
            animation2.MaxFrames = 0;
            animation2.CurrentFrame = 0;
            animationState = 0;
            shooting = false;
            spawning = false;
            entityManager.ghostAll();
            entityManager.brightenScreen();
            //position.Y -= Constants.BOSS_DEATH_OFFSET;
            fireTimer = 0;

            pointLight = new PointLight()
            {
                Color = new Vector4(240, 240, 0, 255),
                Power = 0.2f,
                LightDecay = 200,
                Position = new Vector3(0f, 360f, 50f),
                IsEnabled = true
            };
            entityManager.addLight(pointLight);
        }
Пример #10
0
        public Player(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, string alias, EntityManager entityManager, InputManager controls)
            : base(spriteBatch, game, Constants.PLAYER_FILENAME, new Vector2(Constants.PLAYER_WIDTH, Constants.PLAYER_HEIGHT), alias, EntityType.PLAYER)
        {
            audio = audioManager;
            this.entityManager = entityManager;
            this.controls = controls;
            weapon = new PlayerWeapon(spriteBatch, game, (int)dimension.Y);
            weapon.Damage = damage;
            acceleration = new Vector2 (Constants.PLAYER_ACCELERATION);
            animationState = (int)PlayerAnimationState.IDLE;
            hitFx = new HitFX(game);
            warningGlow = new GlowFX(game, Constants.FLASH_EFFECT_RED_FILENAME, 0.05f, 0.1f, 0.9f);
            this.animation.FrameRate = 30;
            this.maxDeathLightDecay = int.Parse(game.lighting.getValue("PlayerDeath", "MaxDecay"));
            this.maxDeathPower = float.Parse(game.lighting.getValue("PlayerDeath", "MaxPower"));
            this.deathDecayScaleUp = int.Parse(game.lighting.getValue("PlayerDeath", "DecayScaleUp"));
            this.deathDecayScaleDown = int.Parse(game.lighting.getValue("PlayerDeath", "DecayScaleDown"));
            this.deathPowerScaleUp = float.Parse(game.lighting.getValue("PlayerDeath", "PowerScaleUp"));
            this.deathPowerScaleDown = float.Parse(game.lighting.getValue("PlayerDeath", "PowerScaleDown"));
            this.secondExplosionLight = int.Parse(game.lighting.getValue("PlayerDeath", "SecondExplosionLightSize"));
            this.secondExplosionLightScalar = int.Parse(game.lighting.getValue("PlayerDeath", "SecondExplosionLightScalar"));
            this.secondExplosionPower = float.Parse(game.lighting.getValue("PlayerDeath", "SecondExplosionPower"));
            this.secondExplosionPwrScalar = float.Parse(game.lighting.getValue("PlayerDeath", "SecondExplosionPowerScalar"));
            this.fadeOutLight = int.Parse(game.lighting.getValue("PlayerDeath", "FadeOutLightScalar"));
            this.fadeOutPower = float.Parse(game.lighting.getValue("PlayerDeath", "FadeOutPowerScalar"));
            this.healthLightMaxRadius = int.Parse(game.lighting.getValue("PlayerHealthLight", "MaxRadius"));
            this.healthLightMinRadius = int.Parse(game.lighting.getValue("PlayerHealthLight", "MinRadius"));
            this.playerMaxSpeed = float.Parse(game.constants.getValue("PLAYER", "SPEED"));
            this.healthPowerup = int.Parse(game.constants.getValue("HEALTH_POWERUP", "HEALTH"));
            this.tutorial = bool.Parse(game.config.getValue("General", "Tutorial"));
            this.animation.playOnce = true;
            this.animation.FrameRate = 150;
            this.currentHealthRadi = healthLightMaxRadius;
            this.playerHealthLight = new PlayerHealthLight(game, health);
            this.spriteFont = game.Content.Load<SpriteFont>(Constants.GUI_FONT);

            string key = game.config.getValue("Controls", "Shoot");

            if (key == "Space")
            {
                lesserDemonTut = new TutorialString(spriteBatch, game, "shoot", spriteFont, key, Constants.TUTORIAL_BUTTON_FRAME_XLLARGE, new Vector2(120.0f, 0f));
            }
            else if (key == "Enter")
            {
                lesserDemonTut = new TutorialSprite(spriteBatch, game, "shoot", Constants.TUTORIAL_BUTTON_ENTER, Constants.TUTORIAL_BUTTON_FRAME_ENTER, new Vector2(120.0f, 0f));
            }
            else if (key == "LeftShift" || key == "RightShift" || key == "LeftAlt" || key == "RightAlt")
            {
                lesserDemonTut = new TutorialSprite(spriteBatch, game, "shoot", Constants.TUTORIAL_BUTTON_SHIFT, Constants.TUTORIAL_BUTTON_FRAME_LARGE, new Vector2(120.0f, 0f));
            }
            else
            {
                lesserDemonTut = new TutorialString(spriteBatch, game, "shoot", spriteFont, key, Constants.TUTORIAL_BUTTON_FRAME, new Vector2(120.0f, 0f));
            }

            pointLight = new PointLight()
            {
                Color = new Vector4(float.Parse(game.lighting.getValue("PlayerLight", "ColorR")), float.Parse(game.lighting.getValue("PlayerLight", "ColorG")), float.Parse(game.lighting.getValue("PlayerLight", "ColorB")), float.Parse(game.lighting.getValue("PlayerLight", "ColorA"))),
                Power = float.Parse(game.lighting.getValue("PlayerLight", "Power")),
                LightDecay = int.Parse(game.lighting.getValue("PlayerLight", "LightDecay")),
                Position = new Vector3(0f, 0f, float.Parse(game.lighting.getValue("PlayerLight", "ZPosition"))),
                IsEnabled = true,
                renderSpecular = bool.Parse(game.lighting.getValue("PlayerLight", "Specular"))
            };
        }