Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        public override void Load(Textures.TextureName levelBackground)
        {
            base.Load(Textures.TextureName.Level03Background);


            //-------------------------------------
            //--------------- 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);
        }
Ejemplo n.º 3
0
        private int step = 0;   //the chance in Y during the last update


        //Provide the texture name for this level's Background
        //Provide the rectangle in screen coordinates where this background
        //  will be drawn, and also used for window size to match destination
        public LevelSlider(Textures.TextureName background, Rectangle destination)
            : base(background)
        {
            viewport = destination;
            center   = new Vector2((float)viewport.X + (float)viewport.Width / 2.0f,
                                   (float)viewport.Y + (float)viewport.Height / 2.0f);
            midTop    = new Vector2(center.X, (float)viewport.Top);
            midBottom = new Vector2(center.X, (float)viewport.Bottom);

            //the window does not need a texture since we are only using
            //it as a rectangle that moves during update
            window = new GameObject(Textures.TextureName.NullImage);
            window.SetRotation(new Vector2(0, -1));
            window.speed = 0.03f;
        }
Ejemplo n.º 4
0
        //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];
        }
Ejemplo n.º 5
0
        //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());
                }
            }
        }
Ejemplo n.º 6
0
        public MenuItem(
            String name,
            String label,
            Textures.TextureName defaultTexture,
            Textures.TextureName selectedTexture,
            Textures.TextureName disabledTexture,
            MenuItem nullableParent)
            : base(Textures.TextureName.zMAX)
        {
            this.name        = name;
            this.label       = label;
            this.texNormal   = defaultTexture;
            this.texSelected = selectedTexture;
            this.texDisabled = disabledTexture;

            if (nullableParent == null)
            {
                this.subItem = false;
            }
            else
            {
                this.subItem = true;
            }
        }
Ejemplo n.º 7
0
        private IFireMethodWeapon fireMethod;       //Determines the recharge pattern for the weapon (when it can fire)


        //Construction
        public Weapon(Textures.TextureName weaponTexture)
            : base(weaponTexture)
        {
            level = WeaponLevel.one;
        }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
 public Boss(Textures.TextureName textureEnum)
     : base(textureEnum)
 {
     base.LoadContent();
 }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        private int damage = 1;             //the base damage (pre-Scaled)


        public Bullet(Textures.TextureName bulletTexture)
            : base(bulletTexture)
        {
            moveMethod = new MMLinear();    //default move in straight line
        }
Ejemplo n.º 12
0
 public GameObject(Textures.TextureName name)
 {
     //texture
     textureName = name;
 }