public override void FinishMe(Screen screen) { Game.Components.Remove(screen); if (playing) // this call was made from map { // update the score bottomPanel.Winner((screen as Map).WinnerIndex); if (rounds > 0) startRound(); // start next round else // tournament has finished return to the main menu { // stop game playing = false; showResults(); Game.Components.Remove(bottomPanel); } } else { // this means: return to the main menu Enabled = true; Visible = true; } }
//public Map(Game game, SpriteBatch spriteBatch, int width, int height) // : this(game) //{ // _spriteBatch = spriteBatch; // components = new MapObjectCollection(width, height); //} public Map(Game game, SpriteBatch spriteBatch, Screen parent, int playersCount, string mapFile) : this(game, spriteBatch, parent) { this.ActivePlayers = playersCount; players = new Player[playersCount]; createMapFromFile(mapFile); creatures = new List<Being>(); SimpleCreature cr; for (int i = 0; i < playersCount * 2; i++) { cr = new SimpleCreature(this, generator.Next(3, Width - 3), generator.Next(3, Height - 3), "Images/simple1"); creatures.Add(cr); } }
private Map(Game game, SpriteBatch spriteBatch, Screen parent) : base(game, spriteBatch, parent) { backgroundFile = "Images/mapBack1"; explosion = new ParticleSystem(this, "Images/explosion"); smoke = new ParticleSystem(this, "Images/smoke"); toUnload = new LinkedList<MapObject>(); generator = new Random(); }
public MainMenu(Game game, SpriteBatch spriteBatch, Screen parent) : base(game, spriteBatch, parent) { backgroundFile = "Images/mainMenu"; items = new List<MenuItem>(5); Button b = new Button(this, new Action(start), "Start"); b.Position = new Vector2(300, 100); items.Add(b); NumericButton nb = new NumericButton(this, "Players"); nb.Position = new Vector2(300, 200); nb.MinValue = 2; nb.MaxValue = 4; nb.Value = 2; items.Add(nb); nb = new NumericButton(this, "Rounds"); nb.Position = new Vector2(300, 300); nb.MinValue = 1; nb.MaxValue = 10; nb.Value = 4; items.Add(nb); b = new Button(this, new Action(Game.Exit), "Exit"); b.Position = new Vector2(300, 400); items.Add(b); }
public virtual void FinishMe(Screen screen) { }
public void NextScreen(Screen next) { // enable next screen next.Enabled = true; next.Visible = true; // disable this screen Enabled = false; Visible = false; }
public Screen(Game game, SpriteBatch spriteBatch, Screen parent) : this(game) { this.parent = parent; this.spriteBatch = spriteBatch; }
public Results(Game game, SpriteBatch spriteBatch, Screen parent, int[] wins) : base(game, spriteBatch, parent) { backgroundFile = "Images/mainMenu"; this.wins = wins; // only load texture of participating players textures = new Texture2D[wins.Length]; }
public Menu(Game game, SpriteBatch spriteBatch, Screen parent) : base(game, spriteBatch, parent) { }