public Spawner(EnemyManager em, Vector2 position, Camera cam, Texture2D tex) { enemyManager = em; count = rand.Next(350)+50; this.cam = cam; texture = tex; boundingBox = new Rectangle((int)position.X, (int)position.Y, texture.Width,texture.Height); }
public void startGame(int p) { ground = Content.Load<Texture2D>("ground"); Texture2D fireball = Content.Load<Texture2D>("Fireball"); ; bullets = new BulletManager(fireball); walls = new WallManager(cam, GraphicsDevice); players = new PlayerManager(Content, bullets, cam, p); enemies = new EnemyManager(Content, players.players); spawn = new Spawner[10]; Texture2D spawner = Content.Load<Texture2D>("spawner"); for (int i = 0; i < 10; i++) { int y = 10; if((i+1)%2 == 1) y = 420; spawn[i] = new Spawner(enemies, new Vector2((800 * i) + 10, y), cam, spawner); } ui = new UI(players.players, cam); item = new Item(new Vector2(Game1.width - 100 ,215) , players, Content.Load<Texture2D>("Treasure")); }