Exemple #1
0
        public override void initialize(string data)
        {
            this.alpha = 0;
            this.returnData = "";
            this.timer = 0.0;
            this.cleansed = new Sprite(spriteBatch, game, Constants.GUI_LEVEL_CLEANSED);
            cleansedOffset = cleansed.Dimension * 0.5f;
            levelManager = new LevelManager();
            entityManager = new EntityManager(spriteBatch, game, audio, levelManager);

            player = new Player(spriteBatch, game, audio, "player", entityManager, controls);
            Vector2 newPlayerPos = new Vector2((float)Constants.RESOLUTION_VIRTUAL_WIDTH - 200f, (float)Constants.RESOLUTION_VIRTUAL_HEIGHT * 0.5f);
            player.Position = newPlayerPos;
            entityManager.addEntity(player);
            entityManager.initialize();

            Level level = new Level(spriteBatch, game, audio, entityManager, player, controls, Constants.LEVEL01, "level01");
            levelManager.AddLevel(level);
            level = new Level(spriteBatch, game, audio, entityManager, player, controls, Constants.LEVEL02, "level02");
            levelManager.AddLevel(level);
            level = new Level(spriteBatch, game, audio, entityManager, player, controls, Constants.LEVEL03, "level03");
            levelManager.AddLevel(level);

            levelManager.setLevel(data);
            levelComplete = false;
            secondFade = new FadeInOut(spriteBatch, game);
            secondFade.Reset();
            secondFade.alphaValue = 1;
            fade = new FadeInOut(spriteBatch, game);
            fade.Reset();
            fade.FadeIn();
            audio.playMusic("main_music");
        }
Exemple #2
0
        public Boss(SpriteBatch spriteBatch, Soul game, AudioManager audio, GameTime gameTime, string alias, EntityManager entityManager)
            : base(spriteBatch, game, Constants.BOSS_IDLE_FILENAME, new Vector2(Constants.BOSS_WIDTH, Constants.BOSS_HEIGHT), alias, EntityType.BOSS)
        {
            spriteIdle = new Sprite(spriteBatch, game, Constants.BOSS_IDLE_FILENAME);
            spriteShoot = new Sprite(spriteBatch, game, Constants.BOSS_SHOOT_FILENAME);
            spriteSpawn = new Sprite(spriteBatch, game, Constants.BOSS_SPAWN_FILENAME);
            spriteDeath = new Sprite(spriteBatch, game, Constants.BOSS_DEATH_FILENAME);

            this.sprite = spriteSpawn;
            this.animation.MaxFrames = 0;

            animation2 = new Animation(((int)(spriteShoot.X / dimension.X)) - 1);

            this.entityManager = entityManager;
            weapon = new BossWeapon(spriteBatch, game, sprite.Y);
            weapon.Damage = damage;
            offset = Vector2.Zero;

            this.random = new Random();
            hitFx = new HitFX(game);
            velocity.X = 5;
            this.audio = audio;

            fireRate = burst;
            burstPause = int.Parse(game.constants.getValue("BOSS", "BURSTPAUSE"));
        }
Exemple #3
0
 public BloodVessel(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, EntityManager entityManager, Vector2 dimension, EntityType entityType, string alias, string filename)
     : base(spriteBatch, game, filename, dimension, alias, entityType)
 {
     this.audio = audioManager;
     this.entityManager = entityManager;
     this.animation.MaxFrames = 0;
     hitFx = new HitFX(game);
 }
Exemple #4
0
 public BlueBloodvessel(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, EntityManager entityManager, string alias)
     : base(spriteBatch, game, audioManager, entityManager, new Vector2(Constants.BLUE_BLOOD_VESSEL_WIDTH), EntityType.BLUE_BLOOD_VESSEL, alias, Constants.BLUE_BLOOD_VESSEL_FILENAME)
 {
     //maxVelocity = new Vector2(Constants.BLUE_BLOOD_VESSEL_MAX_SPEED, Constants.BLUE_BLOOD_VESSEL_MAX_SPEED);
     acceleration = new Vector2(Constants.BLUE_BLOOD_VESSEL_ACCELERATION, Constants.BLUE_BLOOD_VESSEL_ACCELERATION);
     moveRight = true;
     animation.MaxFrames = 0;
     animation.FrameRate = 30;
 }
Exemple #5
0
 public Nightmare(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, EntityManager entityManager, string alias)
     : base(spriteBatch, game, Constants.NIGHTMARE_FILENAME, new Vector2(Constants.NIGHTMARE_WIDTH, Constants.NIGHTMARE_HEIGHT), alias, EntityType.NIGHTMARE)
 {
     this.entityManager = entityManager;
     //this.maxVelocity = new Vector2 (Constants.NIGHTMARE_MAX_SPEED, Constants.NIGHTMARE_MAX_SPEED);
     this.acceleration = new Vector2 (Constants.NIGHTMARE_ACCELERATION, Constants.NIGHTMARE_ACCELERATION);
     //this.health = Constants.NIGHTMARE_MAX_HEALTH;
     //this.damage = Constants.NIGHTMARE_DAMAGE;
     this.animation.MaxFrames = 12;
     hitFx = new HitFX(game);
     //this.hitRadius = Constants.NIGHTMARE_RADIUS;
     this.audio = audioManager;
 }
Exemple #6
0
 public InnerDemon(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, string alias, EntityManager entityManager, Path path)
     : base(spriteBatch, game, Constants.INNER_DEMON_FILENAME, new Vector2(Constants.INNER_DEMON_WIDTH, Constants.INNER_DEMON_HEIGHT), alias, EntityType.INNER_DEMON)
 {
     this.path = path;
     this.path.Repeat = true;
     //maxVelocity = new Vector2(Constants.INNER_DEMON_MAX_SPEED, Constants.INNER_DEMON_MAX_SPEED);
     acceleration = new Vector2(Constants.INNER_DEMON_ACCELERATION, Constants.INNER_DEMON_ACCELERATION);
     //this.health = Constants.INNER_DEMON_MAX_HEALTH;
     this.entityManager = entityManager;
     this.random = new Random();
     hitFx = new HitFX(game);
     //this.hitRadius = Constants.INNER_DEMON_RADIUS;
     this.audio = audioManager;
     animation.MaxFrames = 0;
 }
Exemple #7
0
 public DarkThought(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, GameTime gameTime, string alias, EntityManager entityManager, Path path)
     : base(spriteBatch, game, Constants.DARK_THOUGHT_FILENAME, new Vector2(Constants.DARK_THOUGHT_WIDTH, Constants.DARK_THOUGHT_HEIGHT), alias, EntityType.DARK_THOUGHT)
 {
     this.audio = audioManager;
     this.entityManager = entityManager;
     weapon = new DarkThoughtWeapon(spriteBatch, game, sprite.Y);
     weapon.Damage = damage;
     //maxVelocity = new Vector2(Constants.DARK_THOUGHT_MAX_SPEED, Constants.DARK_THOUGHT_MAX_SPEED);
     acceleration = new Vector2(Constants.DARK_THOUGHT_ACCELERATION, Constants.DARK_THOUGHT_ACCELERATION);
     this.path = path;
     //this.health = Constants.DARK_THOUGHT_MAX_HEALTH;
     this.animation.MaxFrames = 11;
     hitFx = new HitFX(game);
     //this.hitRadius = Constants.DARK_THOUGHT_RADIUS;
     timeSinceLastBullet = gameTime.TotalGameTime.TotalMilliseconds;
     timeSinceLastBurst = gameTime.TotalGameTime.TotalMilliseconds;
 }
Exemple #8
0
 public DarkWhisper(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, string alias, EntityManager entityManager, Path path)
     : base(spriteBatch, game, Constants.DARK_WHISPER_FILENAME, new Vector2(Constants.DARK_WHISPER_WIDTH, Constants.DARK_WHISPER_HEIGHT), alias, EntityType.DARK_WHISPER)
 {
     if (path != null)
     {
         this.path = path;
         this.chase = false;
     }
     this.entityManager = entityManager;
     //this.health = Constants.DARK_WHISPER_MAX_HEALTH;
     //this.maxVelocity =  new Vector2(Constants.DARK_WHISPER_MAX_SPEED);
     this.acceleration = new Vector2(Constants.DARK_WHISPER_ACCELERATION);
     spikeList = new List<Bullet>();
     this.animation.MaxFrames = 0;
     this.animation.FrameRate = 50;
     hitFx = new HitFX(game);
     this.audio = audioManager;
     //this.hitRadius = Constants.DARK_WHISPER_RADIUS;
 }
Exemple #9
0
 public Level(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, EntityManager entityManager, Player player, InputManager controls, string filename, string id)
 {
     this.spriteBatch = spriteBatch;
     this.game = game;
     this.entityManager = entityManager;
     this.id = id;
     this.controls = controls;
     levelReader = new LevelReader(filename, game);
     this.player = player;
     font = game.Content.Load<SpriteFont>("GUI\\Extrafine");
     this.audioManager = audioManager;
 }
Exemple #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"))
            };
        }