Esempio n. 1
0
 public void newGame()
 {
     this.KeyPreview = true;
     TheGame = new Game(this);
     InitializeTimers();
     Random = new Random();
     groupBox1.BackColor = Color.Transparent;
     currentScore = 0;
 }
Esempio n. 2
0
        private void Start_Click(object sender, EventArgs e)
        {
            var seed = GetSeedArray(Seed.SelectedItem.ToString());

            var scale = int.Parse(Scale.Text);
            var delay = int.Parse(Delay.Text);

            _game = new Game(seed, scale, delay);
            _game.NewGenerationCreated += game_NewGenerationCreated;

            Start.Enabled = false;
            var starter = new ThreadStart(_game.Simulate);
            var thread = new Thread(starter);
            thread.Start();
        }
Esempio n. 3
0
        public void InitGame()
        {
            MapProvider mapProvider = new MapProvider(MapProvider.MapName.Norway);

            List<Player> players = new List<Player>();
            Player playerOne = new Player("knut");
            Player playerTwo = new Player("kari");
            players.Add(playerOne);
            players.Add(playerTwo);

            m_game = new Game(players, Game.Difficulty.easy, Game.Type.none, mapProvider);
            m_game.LoadGame();

            m_ch = new CoordinateHandler(m_game);
        }
Esempio n. 4
0
        public Question(string name, Game.Language language, Location loc)
        {
            m_name = name;
            m_type = loc.LocationTypeValue;



            m_answer = new Answer(name, loc);
            

            string firstPart, secondPart, thirdPart;
            switch (m_type)
            {
                case(Location.LocationType.City):
                    switch (language)
                    {
                        case(Game.Language.Norwegian):
                            secondPart = "byen";
                            break;
                        case(Game.Language.English):
                            secondPart = "the city";
                            break;
                        default:
                            secondPart = "the city";
                            break;
                    }
                    break;
                case(Location.LocationType.Region):
                    switch (language)
                    {
                        case(Game.Language.Norwegian):
                            secondPart = "området";
                            break;
                        case(Game.Language.English):
                            secondPart = "the region";
                            break;
                        default:
                            secondPart = "the region";
                            break;
                    }
                    break;
                default :
                    secondPart = "the city";
                    break;
            }

            switch (language)
            {
                case(Game.Language.Norwegian):
                    thirdPart = "";
                    break;
                case(Game.Language.English):
                    thirdPart = "located";
                    break;
                default:
                    thirdPart = "located";
                    break;
            }

            switch (language)
            {
                case (Game.Language.Norwegian):
                    firstPart = "Hvor er";
                    break;
                case (Game.Language.English):
                    firstPart = "Where is";
                    break;
                default:
                    firstPart = "Where is";
                    break;
            }

            m_question = string.Format("{0} {1} {2} {3}", firstPart, secondPart, m_name, thirdPart);
        }
 public CoordinateHandler(Game game)
 {
     m_game = game;
     m_viewPort = new ViewPort(0, 0, 10, 10);
 }
Esempio n. 6
0
 private void New_Game_Click(object sender, EventArgs e)
 {
     Game game = new Game();
     game.Show();
     this.Hide();
     MenuSound.Stop();
 }
Esempio n. 7
0
File: Form1.cs Progetto: Shpak1/Work
 public Form1()
 {
     InitializeComponent();
     game = new Game(4);
 }