public ActiveKeyframeEffect(KeyframeEffect effect, Rectangle positionRectangle, Color colorInput) { this.effect = effect; rectangle = positionRectangle; color = colorInput; }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here //Load Player Textures Player.shipTexture[0] = Content.Load <Texture2D>("Player/playerShip0"); Player.shipTexture[1] = Content.Load <Texture2D>("Player/playerShip1"); Player.shipTexture[2] = Content.Load <Texture2D>("Player/playerShip2"); Player.shipTexture[3] = Content.Load <Texture2D>("Player/playerShip3"); //Load Player Size float ratio = (float)Player.shipTexture[0].Width / Player.shipTexture[0].Height; Player.size[1] = playerInitSize; Player.size[0] = (int)(Player.size[1] * ratio); Player.sizeRatioToOriginal = (float)playerInitSize / Player.shipTexture[0].Height; //TEST ENEMY //Enemy.enemies.Add(new Enemy(new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2), .2F, 2, 350, (int)(playerInitSize * ratio), playerInitSize, 1000)); //Enemy.enemies.Add(new Enemy(new Vector2(20, 0), .2F, 2, 400, (int)(playerInitSize * ratio), playerInitSize, 1000)); GUI.goldCoin = Content.Load <Texture2D>("UI Textures/goldCoin"); galaxyDebris = Content.Load <Texture2D>("General Textures/galaxyDebris"); asteroidTexture = Content.Load <Texture2D>("General Textures/asteroidTexture"); galaxyBackground = Content.Load <Texture2D>("General Textures/galaxyBackground"); galaxyStars = Content.Load <Texture2D>("General Textures/galaxyStars"); repairCursor = Content.Load <Texture2D>("General Textures/repairCursor"); Projectile.laserBeam = Content.Load <Texture2D>("General Textures/laserBeam"); Projectile.rocketTexture = Content.Load <Texture2D>("General Textures/missileProjectile"); Projectile.laserSound[0] = Content.Load <SoundEffect>("General Sounds/Laser/laserShot0"); Projectile.laserSound[1] = Content.Load <SoundEffect>("General Sounds/Laser/laserShot1"); Player.thrusterSound = Content.Load <SoundEffect>("General Sounds/thrusterSound"); Player.thrusterSoundInstance = Player.thrusterSound.CreateInstance(); Player.thrusterSoundInstance.IsLooped = true; //Load keyframeEffects KeyframeEffect.keyframeEffects.Add(new KeyframeEffect(89, "Keyframe Effects/Building Explosion/explosion")); KeyframeEffect.keyframeEffects.Add(new KeyframeEffect(21, "Keyframe Effects/Laser Spark/explosion")); KeyframeEffect.loadKeyframes(Content); //Load Enemy Sounds Enemy.enemyExplosion = Content.Load <SoundEffect>("General Sounds/Enemy/enemyExplosion"); //Load Minimap textures Minimap.blipTexture = Content.Load <Texture2D>("Minimap Textures/minimapBlip"); Minimap.buildingBlipTexture = Content.Load <Texture2D>("Minimap Textures/minimapBuilding"); //Load Enemy Textures and Collision Points Enemy.enemyTextures[0] = Content.Load <Texture2D>("Enemy Textures/enemyShip"); Enemy.enemyTextures[1] = Content.Load <Texture2D>("Enemy Textures/roundEnemy"); Enemy.enemyTextures[2] = Content.Load <Texture2D>("Enemy Textures/bossEnemy"); Enemy.setCollisionPoints(); //Load UI textures GUI.buildingButtonTextures[0] = Content.Load <Texture2D>("UI Textures/buildingButton"); GUI.buildingButtonTextures[1] = Content.Load <Texture2D>("UI Textures/buildingButtonSelected"); GUI.textures[0] = Content.Load <Texture2D>("UI Textures/buildButton"); GUI.textures[1] = Content.Load <Texture2D>("UI Textures/exitBuildButton"); GUI.textures[2] = Content.Load <Texture2D>("UI Textures/nextTurnButton"); GUI.textures[3] = Content.Load <Texture2D>("UI Textures/pauseButton"); GUI.textures[4] = Content.Load <Texture2D>("UI Textures/saveButton"); GUI.textures[5] = Content.Load <Texture2D>("UI Textures/loadButton"); GUI.textures[6] = Content.Load <Texture2D>("UI Textures/exitButton"); GUI.textures[7] = Content.Load <Texture2D>("UI Textures/resumeButton"); GUI.textures[8] = Content.Load <Texture2D>("UI Textures/repairButton"); GUI.pausedOverlay = Content.Load <Texture2D>("UI Textures/pausedOverlay"); //Load grid textures Tile.selectionOverlay = Content.Load <Texture2D>("Tile Textures/gridSelectionOverlay"); Tile.healthRectangle = Content.Load <Texture2D>("Tile Textures/healthRectangle"); //Buildings (Cannot have same name) Building.buildingTypes.Add(new BuildingType(250, 50, "Basic Mine", 25, Content.Load <Texture2D>("Building Textures/basicMine"))); Building.buildingTypes.Add(new BuildingType(1000, 150, "Advanced Mine", 100, Content.Load <Texture2D>("Building Textures/advancedMine"))); Building.buildingTypes.Add(new BuildingType(500, -25, 500, 5, 500, "Zapper", 50, Color.GhostWhite, Content.Load <Texture2D>("Building Textures/zapperBuilding"))); Building.buildingTypes.Add(new BuildingType(1500, -100, 600, 15, 1000, "Basic Turret", 100, Color.Green, Content.Load <Texture2D>("Building Textures/basicTurret"))); Building.buildingTypes.Add(new BuildingType(3000, -200, 700, 35, 800, "Adv. Turret", 150, Color.Cyan, Content.Load <Texture2D>("Building Textures/advancedTurret"))); float buffStrength = .05F; Building.buildingTypes.Add(new BuildingType(2500, 0, "Factory GPT", 50, new[] { buffStrength, 0, 0, 0 }, Content.Load <Texture2D>("Building Textures/factoryBuilding"))); Building.buildingTypes.Add(new BuildingType(2500, -100, "Factory Damage", 50, new[] { 0, buffStrength, 0, 0 }, Content.Load <Texture2D>("Building Textures/factoryBuilding"))); Building.buildingTypes.Add(new BuildingType(2500, -100, "Factory GoldC", 50, new[] { 0, 0, buffStrength, 0 }, Content.Load <Texture2D>("Building Textures/factoryBuilding"))); Building.buildingTypes.Add(new BuildingType(2500, -100, "Factory EKR", 50, new[] { 0, 0, 0, buffStrength }, Content.Load <Texture2D>("Building Textures/factoryBuilding"))); Building.buildingTypes.Add(new BuildingType(1000000, 0, "Warp Gate", 1, Content.Load <Texture2D>("Building Textures/blackHole"))); //Adds Building Buttons GUI.initializeBuildingButtons(); //Init Grid Tile.initializeGrid(asteroidTexture.Width); //Loading fonts displayFont = Content.Load <SpriteFont>("displayFont"); buildingButtonFont = Content.Load <SpriteFont>("buildingButtonFont"); //Load Player Collision Points Player.initializeCollisionPoints(); }