コード例 #1
0
ファイル: Soul.cs プロジェクト: rodstrom/soul
 protected override void Initialize()
 {
     config = new IniFile("Content\\Config\\config.ini");
     config.parse();
     constants = new IniFile("Content\\Config\\constants.ini");
     constants.parse();
     audioList = new IniFile("Content\\Config\\audiolist.ini");
     audioList.parse();
     lighting = new IniFile("Content\\Config\\lighting.ini");
     lighting.parse();
     this.IsMouseVisible = bool.Parse(config.getValue("General", "ShowMouse"));
     audioManager = new AudioManager(Content, this);
     displayModes = new LinkedList<DisplayMode>();
     foreach (DisplayMode dm in this.GraphicsDevice.Adapter.SupportedDisplayModes)
     {
         if (dm.Format == SurfaceFormat.Color && dm.AspectRatio > 1.7f && dm.AspectRatio < 2f)
         {
             displayModes.AddLast(dm);
         }
     }
     Resolution.Init(ref graphics);
     Resolution.SetVirtualResolution(Constants.RESOLUTION_VIRTUAL_WIDTH, Constants.RESOLUTION_VIRTUAL_HEIGHT);
     Resolution.SetResolution(
         int.Parse(config.getValue("Video", "Width")),
         int.Parse(config.getValue("Video", "Height")),
         bool.Parse(config.getValue("Video", "Fullscreen"))
         );
     base.Initialize();
 }
コード例 #2
0
ファイル: BrainMapManager.cs プロジェクト: rodstrom/soul
        //private BrainMapMarker currentMapMarker = null;
        public BrainMapManager(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, InputManager controls, Vector2 position)
        {
            this.audioManager = audioManager;
            bg = new Sprite(spriteBatch, game, Constants.BRAIN_MAP_BG);
            mapList = new List<BrainMapMarker>();

            List<BrainMapMarker> tmpList = new List<BrainMapMarker>();
            /*mapList.Add(tmpList);
            tmpList = new List<BrainMapMarker>();
            mapList.Add(tmpList);
            tmpList = new List<BrainMapMarker>();
            mapList.Add(tmpList);*/

            menuManager = new MenuManager(controls);
            ImageButton button = new ImageButton(spriteBatch, game, controls, new Vector2((float)Constants.RESOLUTION_VIRTUAL_WIDTH * 0.5f - 150, (float)Constants.RESOLUTION_VIRTUAL_HEIGHT * 0.5f + 200), Constants.GUI_CLEANSE, "cleanse");
            button.onClick += new ImageButton.ButtonEventHandler(OnButtonPress);
            menuManager.AddButton(button);
            button = new ImageButton(spriteBatch, game, controls, new Vector2((float)Constants.RESOLUTION_VIRTUAL_WIDTH * 0.5f + 150, (float)Constants.RESOLUTION_VIRTUAL_HEIGHT * 0.5f + 200), Constants.GUI_BACK, "back");
            button.onClick += new ImageButton.ButtonEventHandler(OnButtonPress);
            menuManager.AddButton(button);
            menuManager.initialize();
            fadeinOut = new FadeInOut(spriteBatch, game, 100);
            this.position = position;
            offset = new Vector2((float)bg.X * 0.5f, (float)bg.Y *0.5f);
            this.controls = controls;
        }
コード例 #3
0
ファイル: Boss.cs プロジェクト: rodstrom/soul
        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"));
        }
コード例 #4
0
ファイル: BloodVessel.cs プロジェクト: rodstrom/soul
 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);
 }
コード例 #5
0
ファイル: State.cs プロジェクト: rodstrom/soul
 public State(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, InputManager controls, string id)
 {
     this.id = id;
     this.spriteBatch = spriteBatch;
     this.audio = audioManager;
     this.game = game;
     this.controls = controls;
 }
コード例 #6
0
ファイル: EntityManager.cs プロジェクト: rodstrom/soul
 public EntityManager(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, LevelManager levelManager)
 {
     this.random = new Random();
     this.spriteBatch = spriteBatch;
     this.levelManager = levelManager;
     this.game = game;
     this.audioManager = audioManager;
     this.tutorial = bool.Parse(game.config.getValue("General", "Tutorial"));
 }
コード例 #7
0
ファイル: BlueBloodvessel.cs プロジェクト: rodstrom/soul
 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;
 }
コード例 #8
0
ファイル: MenuStateManager.cs プロジェクト: rodstrom/soul
 public MenuStateManager(SpriteBatch spriteBatch, Soul game, GraphicsDeviceManager graphics, LinkedList<DisplayMode> displayModes, InputManager inputManager, AudioManager audioManager)
 {
     menu = new Dictionary<string, MenuManager>();
     this.spriteBatch = spriteBatch;
     this.game = game;
     this.inputManager = inputManager;
     this.audioManager = audioManager;
     this.graphics = graphics;
     this.displayModes = displayModes;
 }
コード例 #9
0
ファイル: Nightmare.cs プロジェクト: rodstrom/soul
 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;
 }
コード例 #10
0
ファイル: VolumeSlider.cs プロジェクト: rodstrom/soul
 public VolumeSlider(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, Vector2 position, string id)
     : base(id)
 {
     if (audioManager != null)
     {
         this.audioManager = audioManager;
     }
     slider = new Sprite(spriteBatch, game, Constants.GUI_SLIDER);
     marker = new Sprite(spriteBatch, game, Constants.GUI_SLIDER_MARKER);
     sliderOffset = slider.Dimension * 0.5f;
     markerOffset = marker.Dimension * 0.5f;
     this.position = position;
 }
コード例 #11
0
ファイル: InnerDemon.cs プロジェクト: rodstrom/soul
 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;
 }
コード例 #12
0
ファイル: DarkThought.cs プロジェクト: rodstrom/soul
 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;
 }
コード例 #13
0
ファイル: DarkWhisper.cs プロジェクト: rodstrom/soul
 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;
 }
コード例 #14
0
ファイル: Player.cs プロジェクト: rodstrom/soul
        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"))
            };
        }
コード例 #15
0
ファイル: IntroState.cs プロジェクト: rodstrom/soul
 public IntroState(SpriteBatch spriteBatch, Soul game, AudioManager audioManager, InputManager controls, string id)
     : base(spriteBatch, game, audioManager, controls, id)
 {
 }
コード例 #16
0
ファイル: Level.cs プロジェクト: rodstrom/soul
 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;
 }
コード例 #17
0
ファイル: MenuState.cs プロジェクト: rodstrom/soul
 public MenuState(SpriteBatch spriteBatch, Soul game, GraphicsDeviceManager graphics, LinkedList<DisplayMode> displayModes, AudioManager audioManager, InputManager controls, string id)
     : base(spriteBatch, game, audioManager, controls, id)
 {
     this.graphics = graphics;
     this.displayModes = displayModes;
 }