public void AddItem( String name, String label, Textures.TextureName defaultTexture, Textures.TextureName selectedTexture, Textures.TextureName disabledTexture, MenuItem nullableParent) { items.AddLast(new MenuItem(name, label, defaultTexture, selectedTexture, disabledTexture, nullableParent)); }
private Weapon[] weapons; //the collection of weapons this ship has #endregion Fields #region Constructors //Construction public Ship(Textures.TextureName shipTexture) : base(shipTexture) { //Prevent the level cleaner from removing this ship //until flagged true canClean = false; //Ship Default settings health = 1; points = 1; //Init data lists weaponPort = new Vector2[0]; weaponPortSave = new Vector2[0]; weapons = new Weapon[0]; }
public override void Load(Textures.TextureName levelBackground) { base.Load(Textures.TextureName.Level02Background); //------------------------------------- //--------------- ITEMS --------------- //------------------------------------- itemMan.SetLives(1); itemMan.SetWeapons(2, WeaponType.TripleCanon); //------------------------------------- //--------------- SHIPS --------------- //------------------------------------- List<Spawn> shipSpawns = new List<Spawn>(); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1000, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1040, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1080, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1120, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1000, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1040, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1080, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1120, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); for (int i = 0; i < 50; i++) shipSpawns.Add(new Spawn(SpawnTrigger.Head, PROP.random.Next(400, 2201), ShipType.demoEnemy2, new Vector2(PROP.random.Next(-200, 201), -100), new Vector2(0, 1), Difficulty.Medium)); for (int i = 0; i < 50; i++) shipSpawns.Add(new Spawn(SpawnTrigger.Head, PROP.random.Next(400, 2201), ShipType.demoEnemy3, new Vector2(PROP.random.Next(-200, 201), -100), new Vector2(0, 1), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2000, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2040, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2080, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2120, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2000, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2040, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2080, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2120, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); slider.AddSpawns(shipSpawns); }
//The main loading of the level //Child classes (the actuall level objects) //should call this base method first to Init the basic stuff public virtual void Load(Textures.TextureName levelBackground) { loaded = true; border = new GameObject(Textures.TextureName.LevelBorder); border.LoadContent(); border.CenterIn(bounds); slider = new LevelSlider(levelBackground, bounds); slider.Load(); //Items itemMan = new ItemManager(ref slider); //Init data structures enemyShips = new List<Ship>(); enemyBullets = new List<Bullet>(); items = new List<Item>(); //Link the UpdateInfo to appropriate data SUI = new ShipUpdateInfo(); SUI.viewport = bounds; SUI.npcs = enemyShips; SUI.slider = this.slider; //Position the player ships foreach (Player p in PROP.players) { if (p.ControllerIndex == PlayerIndex.Two) { p.ship.MoveTo(GetPlayerInitPos()); p.ship.position.X += 60; } else p.ship.MoveTo(GetPlayerInitPos()); } }
public override void Load(Textures.TextureName levelBackground) { base.Load(Textures.TextureName.Level01Background); //------------------------------------- //--------------- BOSS ---------------- //------------------------------------- boss = new Boss1(); //------------------------------------- //--------------- ITEMS --------------- //------------------------------------- itemMan.SetLives(1); itemMan.SetWeapons(30, WeaponType.TripleCanon); //------------------------------------- //--------------- SHIPS --------------- //------------------------------------- List<Spawn> shipSpawns = new List<Spawn>(); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1000, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1040, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1080, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1120, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1000, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1040, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1080, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 1120, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); //for (int i = 0; i < 20; i++) // shipSpawns.Add(new Spawn(SpawnTrigger.Head, PROP.random.Next(400, 2201), ShipType.demoEnemy4, new Vector2(PROP.random.Next(-200, 201), -100), new Vector2(0, 1), Difficulty.Medium)); //for (int i = 0; i < 20; i++) // shipSpawns.Add(new Spawn(SpawnTrigger.Head, PROP.random.Next(400, 2201), ShipType.demoEnemy3, new Vector2(PROP.random.Next(-200, 201), -100), new Vector2(0, 1), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2000, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Insanity)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2040, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Hard)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2080, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2120, ShipType.demoEnemy, new Vector2(-350, 0), new Vector2(0.5f, 0.6f), Difficulty.Easy)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2000, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Insanity)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2040, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Hard)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2080, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Medium)); //shipSpawns.Add(new Spawn(SpawnTrigger.Head, 2120, ShipType.demoEnemy, new Vector2(350, 0), new Vector2(-0.5f, 0.6f), Difficulty.Easy)); /************** Jose ADDED ************/ //for (int i = 0; i < 20; i++) // shipSpawns.Add(new Spawn(SpawnTrigger.Head, PROP.random.Next(400, 2201), ShipType.shipEnemy1, new Vector2(PROP.random.Next(-200, 201), -100), new Vector2(0, 1), Difficulty.Easy)); for (int i = 0; i < 20; i++) shipSpawns.Add(new Spawn(SpawnTrigger.Head, PROP.random.Next(400, 2201), ShipType.shipEnemy2, new Vector2(PROP.random.Next(-200, 201), -100), new Vector2(0, 1), Difficulty.Easy)); int Leadpos_Y; int Leadpos_X; //Squadron 1a Leadpos_Y = 2060; // Big numbers -> Lower map pos / Small numbs -> Higher map pos Leadpos_X = 0 - 100; //center of the viewport (0,0) shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy1, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy1, new Vector2(Leadpos_X - 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy1, new Vector2(Leadpos_X + 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy1, new Vector2(Leadpos_X - 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy1, new Vector2(Leadpos_X + 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); //Squadron 1b Leadpos_Y = 2100; // Big numbers -> Lower map pos / Small numbs -> Higher map pos Leadpos_X = 0 + 100; //center of the viewport (0,0) shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy1, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy1, new Vector2(Leadpos_X - 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy1, new Vector2(Leadpos_X + 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy1, new Vector2(Leadpos_X - 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy1, new Vector2(Leadpos_X + 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); //Squadron 2 Leadpos_Y = 1940; Leadpos_X = 0; shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy2, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy2, new Vector2(Leadpos_X - 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy2, new Vector2(Leadpos_X + 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy2, new Vector2(Leadpos_X - 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy2, new Vector2(Leadpos_X + 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); //Squadron 3 Leadpos_Y = 1874; Leadpos_X = 0; shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy2, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy2, new Vector2(Leadpos_X - 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy2, new Vector2(Leadpos_X + 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy2, new Vector2(Leadpos_X - 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 20, ShipType.shipEnemy2, new Vector2(Leadpos_X + 70, 0), new Vector2(0f, 1f), Difficulty.Easy)); //Squadron 4a Leadpos_Y =1780; // Big numbers -> Lower map pos / Small numbs -> Higher map pos Leadpos_X = 0 - 120; //center of the viewport (0,0) shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy3, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy3, new Vector2(Leadpos_X - 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy3, new Vector2(Leadpos_X + 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); //Squadron 4b Leadpos_Y = 1780; // Big numbers -> Lower map pos / Small numbs -> Higher map pos Leadpos_X = 0 + 120; //center of the viewport (0,0) shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy3, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy3, new Vector2(Leadpos_X - 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y - 10, ShipType.shipEnemy3, new Vector2(Leadpos_X + 40, 0), new Vector2(0f, 1f), Difficulty.Easy)); //Squadron 5 Leadpos_Y = 1720; Leadpos_X = 0; shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y, ShipType.shipEnemy2, new Vector2(Leadpos_X, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y + 5, ShipType.shipEnemy2, new Vector2(Leadpos_X - 60, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y + 5, ShipType.shipEnemy2, new Vector2(Leadpos_X + 60, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y + 15, ShipType.shipEnemy2, new Vector2(Leadpos_X - 80, 0), new Vector2(0f, 1f), Difficulty.Easy)); shipSpawns.Add(new Spawn(SpawnTrigger.Head, Leadpos_Y + 15, ShipType.shipEnemy2, new Vector2(Leadpos_X + 80, 0), new Vector2(0f, 1f), Difficulty.Easy)); /************** Jose ADDED ************/ slider.AddSpawns(shipSpawns); }
//The only way to get this single instance public static Textures GetInstance() { if (instance == null) instance = new Textures(); return instance; }
//Construction public Weapon(Textures.TextureName weaponTexture) : base(weaponTexture) { level = WeaponLevel.one; }
private Vector2 moveDir; //the direction of movement, should be 0,0 or a normalized vector #endregion Fields #region Constructors public GameObject(Textures.TextureName name) { //texture textureName = name; }
public Boss(Textures.TextureName textureEnum) : base(textureEnum) { base.LoadContent(); }