Exemplo n.º 1
0
 public SimpleView(BaseModel baseModel, GraphicsDeviceManager graphics, ContentManager content)
 {
     this.baseModel = baseModel;
     this.graphics  = graphics;
     this.gm        = (App)App.Instance;
     this.content   = content;
     //initializes the sprite batch
     spritebatch = new SpriteBatch(graphics.GraphicsDevice);
     //Loads the sprites
     enemy      = content.Load <Texture2D>("Drone");
     bulletNorm = content.Load <Texture2D>("bullet");
     bulletDisc = content.Load <Texture2D>("discbullet");
     bulletWide = content.Load <Texture2D>("widebullet");
     middle     = content.Load <Texture2D>("centre");
     try
     {
         middle0 = content.Load <Texture2D>("tower-0");
         middle1 = content.Load <Texture2D>("tower-1");
         middle2 = content.Load <Texture2D>("tower-2");
     }
     catch (Exception)
     {
         simpleMid = true;
     }
     gun1       = content.Load <Texture2D>("turret");
     gun2       = content.Load <Texture2D>("2turret");
     gun3       = content.Load <Texture2D>("3turret");
     boss       = content.Load <Texture2D>("spaceinvader");
     background = content.Load <Texture2D>("bg1");
     graphics.GraphicsDevice.Clear(Color.Black);
     //Initializes the bloom postprocessing with the device to display on
     bloom = new BloomPostprocess.BloomComponent(gm, graphics.GraphicsDevice);
     //Registers the bloom compenent to the list of compenents, it will be drawn AFTER the rest of the game.
     gm.Components.Add(bloom);
     particleEngine              = new PEngine(this);
     menuManager                 = new MenuDrawers.MenuManager();
     baseModel.Tower.ZeroHealth += new EventHandler(OnDeath);
 }
Exemplo n.º 2
0
 public SimpleView(BaseModel baseModel, GraphicsDeviceManager graphics, ContentManager content)
 {
     this.baseModel = baseModel;
     this.graphics = graphics;
     this.gm = (App) App.Instance;
     this.content = content;
     //initializes the sprite batch
     spritebatch = new SpriteBatch(graphics.GraphicsDevice);
     //Loads the sprites
     enemy = content.Load<Texture2D>("Drone");
     bulletNorm = content.Load<Texture2D>("bullet");
     bulletDisc = content.Load<Texture2D>("discbullet");
     bulletWide = content.Load<Texture2D>("widebullet");
     middle = content.Load<Texture2D>("centre");
     try
     {
       middle0 = content.Load<Texture2D>("tower-0");
       middle1 = content.Load<Texture2D>("tower-1");
       middle2 = content.Load<Texture2D>("tower-2");
     }
     catch (Exception)
     {
       simpleMid = true;
     }
     gun1 = content.Load<Texture2D>("turret");
     gun2 = content.Load<Texture2D>("2turret");
     gun3 = content.Load<Texture2D>("3turret");
     boss = content.Load<Texture2D>("spaceinvader");
     background = content.Load<Texture2D>("bg1");
     graphics.GraphicsDevice.Clear(Color.Black);
     //Initializes the bloom postprocessing with the device to display on
     bloom = new BloomPostprocess.BloomComponent(gm, graphics.GraphicsDevice);
     //Registers the bloom compenent to the list of compenents, it will be drawn AFTER the rest of the game.
     gm.Components.Add(bloom);
     particleEngine = new PEngine(this);
     menuManager = new MenuDrawers.MenuManager();
     baseModel.Tower.ZeroHealth += new EventHandler(OnDeath);
 }