public void create(int screenWidth, int screenHeight, OnAsynCreate callback)
        {
            QuantumGame       game       = new QuantumGame();
            QuantumMapBuilder mapBuilder = new QuantumMapBuilder();

            game.start(mapBuilder.initializeMap(screenWidth, screenHeight), screenWidth, screenHeight);

            callback(game);
        }
예제 #2
0
        private void CreateServerGame(int width, int height, OnAsynCreate callback)
        {
            currentTeam = (random.Next() % 2 == 0) ? Team.blue : Team.green;

            QuantumMapBuilder mapBuilder = new QuantumMapBuilder();

            model = mapBuilder.initializeMap(width, height);

            ShareGameEvent shareGame = new ShareGameEvent();

            shareGame.model = model;

            network.BroadcastMessage(shareGame);

            QuantumGame game = new QuantumGame();

            game.gameNetwork = network;
            game.AddController(new NetworkSync(true));
            game.start(model, width, height);

            callback(game);
        }