public Projectile(GraphicsContext g, Texture2D tex, PlayerShip pl, int spd, int dmg)
 {
     graphics        = g;
     sprite          = new Sprite(graphics, tex);
     sprite.Position = pl.Position;
     sprite.Center   = new Vector2(.5f, .5f);
     speed           = spd;
     center          = new Vector3(sprite.Position.X + 5f, sprite.Position.Y + 5f, 0);
     sprite.Rotation = pl.Rotation;
     isAlive         = true;
     damage          = dmg;
 }
Beispiel #2
0
        public Weapon(GraphicsContext g, Texture2D tex, PlayerShip pl, int uid)
        {
            player   = pl;
            uniqueID = uid;
            damage   = 0;

            //create
            sprite          = new Sprite(g, tex);
            sprite.Position = pl.Position;
            sprite.Center   = new Vector2(.5f, .5f);

            sprite.Rotation = pl.Rotation;
        }
Beispiel #3
0
 public Guardian(GraphicsContext g, Texture2D tex, PlayerShip pShip, List <Enemy> eList, int hp, int st, int x, int y) : base(g, tex, hp, st)
 {
     shipWidth       = sprite.Width;
     shipHeight      = sprite.Height;        // this may need to be killed later.
     position        = new Vector3(x, y, 0); // you are going to adjust here to move it off screen.
     sprite.Position = position;
     sprite.Center   = new Vector2(.5f, .5f);
     speed           = 1f;
     velocity        = new Vector3(0, 0, 0);
     playership      = pShip;
     enemyList       = eList;
     rotation        = 0;
 }
Beispiel #4
0
//*****************************************************************************
//*****************************************************************************
//                            New Game Initialize
//*****************************************************************************
//*****************************************************************************
        private static void InitializeNewGame()
        {
            //Load things
            Texture2D bgTex = new Texture2D("/Application/Assets/Background.png", false);

            background       = new BackGround(graphics, bgTex);
            playership       = new PlayerShip(graphics);
            powerstation     = new PowerStation(graphics);
            enemyList        = new List <Enemy> ();
            weaponPlayerList = new List <Weapon>();
            weaponScaterList = new List <Weapon>();
            projectileList   = new List <Projectile>();
            projectileListE  = new List <Projectile>();
            hud         = new HUD(graphics);
            r           = new Random();
            badguyTimer = 0;

            //LoadingSounds
            MusicPlay("/Application/Assets/MainPlay.mp3");

            //WeaponSounds
            Sound soundEffect;

            soundEffect   = new Sound("/Application/Assets/Bullet.wav");
            bulletSound   = soundEffect.CreatePlayer();
            soundEffect   = new Sound("/Application/Assets/Missle.wav");
            missleSound   = soundEffect.CreatePlayer();
            soundEffect   = new Sound("/Application/Assets/DropBomb.wav");
            dropBombSound = soundEffect.CreatePlayer();

            //enemy creation
            texture = new Texture2D("/Application/Assets/MotherShip.png", false);
            enemyList.Add(new MotherShip(graphics, texture, powerstation, enemyList, 1000, 1, -200, 50));
            CreateSmallBaddys();
            texture = new Texture2D("/Application/Assets/Guardian.png", false);
            enemyList.Add(new Guardian(graphics, texture, playership, enemyList, 250, 2, 0, r.Next(600, 1000)));

            //Weapon Creation
            gunTexFile = "/Application/Assets/gun.png";
            texture    = new Texture2D(gunTexFile, false);
            weaponScaterList.Add(new Guns(graphics, texture, new Vector3(200, 300, 0), 0f, 1));
            missleTexFile = "/Application/Assets/MissleGun.png";
            texture       = new Texture2D(missleTexFile, false);
            weaponScaterList.Add(new Guns(graphics, texture, new Vector3(400, 200, 0), 0f, 2));
            DropOffTexFile = "/Application/Assets/DropBox.png";
            texture        = new Texture2D(DropOffTexFile, false);
            weaponScaterList.Add(new Guns(graphics, texture, new Vector3(600, 100, 0), 0f, 3));

            currentState = GameState.Playing;
        }
Beispiel #5
0
 public Guns(GraphicsContext g, Texture2D tex, PlayerShip pl, int uid) : base(g, tex, pl, uid)
 {
     Ammo   = 10;
     Damage = 1;
 }
 public DropOff(GraphicsContext g, Texture2D tex, PlayerShip pl, int uid) : base(g, tex, pl, uid)
 {
     Ammo   = 2;
     Damage = 100;
 }
 public Missle(GraphicsContext g, Texture2D tex, PlayerShip pl, int uid) : base(g, tex, pl, uid)
 {
     Ammo   = 5;
     Damage = 25;
 }