Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        //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);
            }
        }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public virtual void FinishMe(Screen screen) { }
Exemplo n.º 6
0
 public void NextScreen(Screen next)
 {
     // enable next screen
     next.Enabled = true;
     next.Visible = true;
     // disable this screen
     Enabled = false;
     Visible = false;
 }
Exemplo n.º 7
0
 public Screen(Game game, SpriteBatch spriteBatch, Screen parent)
     : this(game)
 {
     this.parent = parent;
     this.spriteBatch = spriteBatch;
 }
Exemplo n.º 8
0
 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];
 }
Exemplo n.º 9
0
 public Menu(Game game, SpriteBatch spriteBatch, Screen parent)
     : base(game, spriteBatch, parent) { }