Exemple #1
0
 public int render(SpaceShooter obj)
 {
     if (p.DeadPlayer())
     {
         managePlayer();
         healthBallFunction();
         managePlayerBullet();
         if (p.score >= 5 && two == 0)
         {
             DisplayScore(one);
             return(Level2());
         }
         else if (p.score >= 10)
         {
             return(Level3());
         }
         else
         {
             DisplayScore(one);
             mangeEnemy();
         }
     }
     else
     {
         gameOver();
     }
     return(0);
 }
 public HealthBall(Player p, Graphics g, SpaceShooter obj)
 {
     this.g   = g;
     this.p   = p;
     this.obj = obj;
     tile     = new Bitmap(Properties.Resources.HealthBall);
 }
Exemple #3
0
 public GameInitializer(Graphics g, SpaceShooter obj)
 {
     this.g     = g;
     this.obj   = obj;
     p          = new Player(obj, g);
     objLeft    = new LeftEnemy(obj, g, p);
     healthBall = new HealthBall(p, g, obj);
 }
Exemple #4
0
 public Player(SpaceShooter obj, Graphics g)
 {
     this.g   = g;
     this.obj = obj;
     tile     = new Bitmap(Properties.Resources.PlayerStationary);
     newLoc   = new Vector2((obj.ClientSize.Width - tile.Width) / 2, obj.ClientSize.Height - tile.Height);
     this.g.DrawImage(tile, newLoc.x, newLoc.y);
     this.health = 100;
     this.rect   = new Rectangle((int)(newLoc.x), (int)(newLoc.y), tile.Width, tile.Height);
     this.score  = 0;
 }
 public FinalBoss(SpaceShooter obj, Graphics g, Player p) : base(obj, g, p)
 {
     this.g   = g;
     this.obj = obj;
     this.p   = p;
     tile     = new Bitmap(Properties.Resources.FinalBoss);
     tile.RotateFlip(RotateFlipType.Rotate180FlipNone);
     newLoc = new Vector2((obj.ClientSize.Width - tile.Width) / 2, tile.Height / 2 + 20);
     this.g.DrawImage(tile, newLoc.x, newLoc.y);
     this.health = 250;
     this.rect   = new Rectangle((int)(newLoc.x) + 5, (int)(newLoc.y), tile.Width - 10, tile.Height - 10);
     direc       = "Left";
 }
Exemple #6
0
 public Enemy(SpaceShooter obj, Graphics g, Player p)
 {
     this.g   = g;
     this.obj = obj;
     this.p   = p;
     tile     = new Bitmap(Properties.Resources.Enemy);
     tile.RotateFlip(RotateFlipType.Rotate180FlipNone);
     newLoc = new Vector2(r.Next(0, obj.ClientSize.Width - tile.Width) - 10, 0);
     this.g.DrawImage(tile, newLoc.x, newLoc.y);
     this.health  = 100;
     this.rect    = new Rectangle((int)newLoc.x, (int)newLoc.y, tile.Width, tile.Height);
     isReady      = true;
     time         = 0;
     maxBullCount = 1;
     bullCount    = 1;
 }