public TutorialString(SpriteBatch spriteBatch, Soul game, string id, SpriteFont spriteFont, string key, string frameFilename, Vector2 positionOffset) : base(spriteBatch, game, id, frameFilename, positionOffset) { this.spriteFont = spriteFont; this.key = key; this.keyOffset = spriteFont.MeasureString(key) / 2; }
public MenuImage(SpriteBatch spriteBatch, Soul game, Vector2 position, string filename, string id) : base(id) { image = new Sprite(spriteBatch, game, filename); offset = image.Dimension * 0.5f; this.position = position; }
public TutorialSprite(SpriteBatch spriteBatch, Soul game, string id, string keyFilename, string frameFilename, Vector2 positionOffset, float rotation = 0f) : base(spriteBatch, game, id, frameFilename, positionOffset) { this.key = new Sprite(spriteBatch, game, keyFilename); this.keyOffset = key.Dimension * 0.5f; this.rotation = rotation; }
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")); }
public Bullet(Random r, int range, SpriteBatch spriteBatch, Soul game, Vector2 position, Vector2 velocity, string filename, string alias, EntityType type, int damage) : base(spriteBatch, game, filename, new Vector2(Constants.DARK_WHISPER_SPIKE_WIDTH, Constants.DARK_WHISPER_SPIKE_HEIGHT), alias, type) { spikeRange = range; useRange = true; originalPosition = position; spike = true; animation.CurrentFrame = r.Next(3); 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(1f, 1f, 1f, 1f), Power = 2f, LightDecay = 100, Position = new Vector3(0f, 0f, 70f), IsEnabled = true }; }*/ }
public GlowParticle(SpriteBatch spriteBatch, Soul game, string alias, Vector2 position) : 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; }
public ScrollingBackground(SpriteBatch spriteBatch, Soul game, string filename, string id, uint startTime, uint deleteTime, float scrollSpeed, float layer, bool persistScroll) { this.startTime = startTime; if (deleteTime == 0) { this.deleteTime = uint.MaxValue; } else { this.deleteTime = deleteTime; } this.id = id; this.layer = layer; this.persistScroll = persistScroll; sprite = new Sprite(spriteBatch, game, filename); filename += "_depth"; normal = new Sprite(spriteBatch, game, filename); if (startTime != 0) { scanner = new BGScanner(game, new Vector2(sprite.X, sprite.Y), scrollSpeed, false); wait = true; visible = false; } else { scanner = new BGScanner(game, new Vector2(sprite.X, sprite.Y), scrollSpeed, true); } scanner.callDead += new BGScanner.CallDeadEvent(nowDead); }
public FadeInOut(SpriteBatch spriteBatch, Soul game, int maxAlpha) { sprite = new Sprite(spriteBatch, game, Constants.BLACK); screenSize = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height); this.maxAlpha = maxAlpha; alphaValue = 254; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Soul game = new Soul()) { game.Run(); } }
public TutorialManager(SpriteBatch spriteBatch, Soul game, SpriteFont spriteFont, InputManager inputManager) { this.tutorialList = new List<TutorialBase>(); this.spriteBatch = spriteBatch; this.game = game; this.spriteFont = spriteFont; this.inputManager = inputManager; }
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); }
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; }
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; }
public LevelReader(string filename, Soul game) { this.filename = filename; file = new StreamReader(filename); entityDataList = new List<EntityData>(); bgData_back = new List<BackgroundData>(); bgData_front = new List<BackgroundData>(); this.config = game.config; }
public Memory(SpriteBatch spriteBatch, Soul game, string filename, float scrollSpeed, uint startTime, uint stopTime, float layer) { sprite = new Sprite(spriteBatch, game, filename); filename += "_depth"; normal = new Sprite(spriteBatch, game, filename); this.scrollSpeed = scrollSpeed; this.startTime = startTime; this.stopTime = stopTime; this.layer = layer; }
public TutorialWidget(SpriteBatch spriteBatch, Soul game, string id, string filename, Vector2 positionOffset) { this.spriteBatch = spriteBatch; this.game = game; this.frame = new Sprite(spriteBatch, game, filename); this.frameOffset = frame.Dimension * 0.5f; this.positionOffset = positionOffset; this.glow = new GlowFX(game, 0.01f, 0.4f, 0.9f); this.id = id; }
public ImageButton(SpriteBatch spriteBatch, Soul game, InputManager controls, Vector2 position, string filename, string id) : base(id) { this.controls = controls; this.position = position; button = new Sprite(spriteBatch, game, filename); hover = new Sprite(spriteBatch, game, Constants.MENU_HOVER); offset = button.Dimension * 0.5f; glowOffset = hover.Dimension * 0.5f; glowOffset.Y -= 6f; }
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")) }; } }
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; }
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; }
public Selection(SpriteBatch spriteBatch, Soul game, Vector2 position, string id) : base(id) { this.spriteBatch = spriteBatch; this.game = game; selectionList = new Dictionary<string, KeyValuePair<Sprite, Vector2>>(); this.position = position; leftArrow = new Sprite(spriteBatch, game, Constants.GUI_ARROW_LEFT); rightArrow = new Sprite(spriteBatch, game, Constants.GUI_ARROW_RIGHT); leftArrowOffset = leftArrow.Dimension * 0.5f; rightArrowOffset = rightArrow.Dimension * 0.5f; this.IsSelection = true; }
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")) }; }
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; }
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 }; }
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; }
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")) }; }
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")) }; }
public BackgroundPillar(SpriteBatch spriteBatch, Soul game, string filename, uint appearTime, float scrollSpeed, float layer, bool persistScroll) { sprite = new Sprite(spriteBatch, game, filename); filename += "_depth"; normal = new Sprite(spriteBatch, game, filename); this.layer = layer; this.scrollSpeed = scrollSpeed; this.persistScroll = persistScroll; if (scrollSpeed > 0.0f) { position.X = 0.0f - (float)sprite.X; } else if (scrollSpeed < 0.0f) { position.X = (float)game.Window.ClientBounds.Width; } screenSize = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height); spriteWidth = (float)sprite.X; }
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; }
public PillarBatch(BackgroundManager backgroundManager, SpriteBatch spriteBatch, Soul game, int lowestSpawn, int highestSpawn, int deadTime, float direction, bool randomDirection, bool randomSpeed, float layer, bool persistScroll) { this.backgroundManager = backgroundManager; this.randomSpeed = randomSpeed; this.fileNameList = new List<string>(); this.persistScroll = persistScroll; CreateFileNameList(); this.spriteBatch = spriteBatch; this.game = game; this.layer = layer; this.scrollSpeed = direction; this.randomDirection = randomDirection; this.pillarList = new List<BackgroundPillar>(); this.killList = new List<BackgroundPillar>(); this.random = new Random(); this.lowestSpawn = lowestSpawn; this.highestSpawn = highestSpawn; SetNewSpawnRate(); this.deadTime = deadTime; }