void Start()
    {
        GM = GameManager.Instance;
        currentArea = GM.getCurrentGameLevel();

        for (int xIndex=0; xIndex<GameLevel.EDGE_SIZE_X; xIndex++) {
            for (int zIndex=0; zIndex<GameLevel.EDGE_SIZE_Z; zIndex++) {
                Vector3 targetPoint = new Vector3(xIndex, -0.5f, zIndex);
                GameField field = currentArea.getField(xIndex, zIndex);
                string className = field.GetType().Name;

                switch (className)
                {
                    case "GrassGameField":
                        Instantiate(CubeForFloor, targetPoint, Quaternion.identity);
                        break;
                    case "StoneGameField":
                        Instantiate(CubeForStoneFloor, targetPoint, Quaternion.identity);
                        break;
                    case "WaterGameField":
                        Instantiate(CubeForWater, targetPoint, Quaternion.identity);
                        break;
                    default:
                        Debug.LogError("Cannot instantiate field for type " + className);
                        break;
                }
            }
        }

        //Instantiate(altar, new Vector3(5, 0, 18), Quaternion.identity);
    }
        private void btnCreate_Click(object sender, EventArgs e)
        {
            bool passed = false;
            if (imagePath == string.Empty || txtLevelName.Text == string.Empty)
            {
                MessageBox.Show("You must select a file and fill out a Level Name");
            }
            else if (bground.Width != this.nudWidth.Value || bground.Height != this.nudHeight.Value)
            {
                DialogResult dialogResult = MessageBox.Show("The resolution you specified is different then that of the image, Are you sure you want to resize?", "Confirm", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    this.bground = new Bitmap(this.bground, new Size((int)this.nudWidth.Value, (int)this.nudHeight.Value));
                    MessageBox.Show("New Width, Height : " + this.bground.Size);
                    passed = true;
                }

            }
            else
            {
                passed = true;
            }

            if(passed)
            {
                GameLevel tmpLevel = new GameLevel(this.bground, this.txtLevelName.Text);
                this.aNewLevel = tmpLevel;
                this.DialogResult = DialogResult.OK;
            }
        }
示例#3
0
文件: Game.cs 项目: ZuTa/Othello
 public Game(string name1, string name2)
 {
     this.level = Game.GetLevel();
     this.cellCollection = new ObservableCollection<CellControl>();
     this.nameOfPlayer1 = name1;
     this.nameOfPlayer2 = name2;
 }
示例#4
0
 public void OnLevelStart(GameLevel level)
 {
     modifiers = new List<GameObject>();
     foreach(GameObject modifierprototype in level.gameModeModifiers) {
         modifiers.Add(Instantiate<GameObject>(modifierprototype));
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerResult" /> class.
 /// </summary>
 /// <param name="level">The level this server is running.</param>
 /// <param name="gameMode">The game mode this server is running.</param>
 /// <param name="gamePreset">The game preset this server is running.</param>
 /// <param name="url">The URL to the server on BattleLog.</param>
 public ServerResult(GameLevel level, GameMode gameMode, GamePreset gamePreset, string url)
 {
     Level = level;
     GameMode = gameMode;
     GamePreset = gamePreset;
     Url = url;
 }
	/// <summary>
	/// Setup the level.
	/// </summary>
	/// <param name="level">Level.</param>
	public void SetupLevel (GameLevel level)
	{
		Array.Clear (EmaGrid, 0, Constants.EMA_MAX_ROWS * Constants.EMA_MAX_COLUMNS);
		BallsRemaining = level.BallCount;
		EmaCollected = 0;
		Level = level;
	}
示例#7
0
 private DrugAffector(GameLevel level)
     : base()
 {
     duration = GameConst.DRUG_DURATION_MS[(int)level];
     targets = GameObject.FindObjectsOfType<Pawn>().ToList();
     syncBeahavior = SyncBeahavior.I;
 }
示例#8
0
        public void Initialize(int spookPrototypeIndex, GameLevel level)
        {
            BaseInitialize(spookPrototypeIndex, level);
            avatar.Initialize(this);
            state = AIState.FirstWalk;

            NextAction();
        }
示例#9
0
文件: Wall.cs 项目: diable201/ICT
 public void NextLevel()
 {
     if (_gameLevel == GameLevel.First)
     {
         _gameLevel = GameLevel.Second;
     }
     LoadLevel();
 }
示例#10
0
    // 按键
    //public void SetGameEasy()
    //{
    //    level = GameLevel.Easy;
    //    // 界面对应有什么变化吗?
    //}

    //public void SetGameDiff()
    //{
    //    level = GameLevel.Difficult;
    //}

    // 单选框
    public void SetGameEasy(bool value)
    {
        if (value)
        {
            level = GameLevel.Easy;
            // 界面对应有什么变化吗?
        }
    }
示例#11
0
文件: GameLevel.cs 项目: yhrmh/test
 private void OnEnable()
 {
     Current = this;
     if (persistableObjects == null)
     {
         persistableObjects = new PersistableObject[0];
     }
 }
示例#12
0
 private void OnEnable()
 {
     Current = this;
     if (levelObjects == null)
     {
         levelObjects = new GameLevelObject[0];
     }
 }
示例#13
0
 public override void HandleLeave(GameLevel gameLevel, SkyPlayer player)
 {
     if (gameLevel.GetGamePlayerCount() <= 2)
     {
         //Not enough players for the game to continue!
         gameLevel.UpdateGameState(new BuildBattlePodiumState(null));
     }
 }
示例#14
0
 public TowerBase GetTower(GameLevelTime time, GameLevel gameLevel, TowerSettings towerSettings)
 {
     return(_container
            .With("gameLevelTime").EqualTo(time)
            .With("gameLevel").EqualTo(gameLevel)
            .With("settings").EqualTo(towerSettings)
            .GetInstance <TowerBase>());
 }
示例#15
0
        public void Initialize(int spookPrototypeIndex, GameLevel level, JsonNPC jsonNPC)
        {
            BaseInitialize(spookPrototypeIndex, level);
            avatar.Initialize(this, jsonNPC.Avatar);
            state = jsonNPC.State;

            NextAction();
        }
示例#16
0
 protected override void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "Player")
     {
         GameLevel.CollectStar(value);
         CreateEffect();
     }
 }
示例#17
0
    void Awake()
    {
        GameLevelMaker.InitLevels();
        GameLevel gameLevel = GameLevelMaker.GetLevel(0);

        ScrollingObject.SetScrollSpeeds(gameLevel);
        RandomObjectPool.SetSpawnTimes(gameLevel);
    }
示例#18
0
	public void Init()
	{
		m_levelData = new GameLevel();
		m_levelData.LoadFromSource(new Level1());
		m_snake = GameObject.Find("SnakeObject").GetComponent<Snake>();
		m_headZ = 0;
		m_goldNum = 0;
	}
示例#19
0
 /// <summary>
 /// Initialization of a new game
 /// </summary>
 /// <param name="currentLevel">game level to start with</param>
 private void StartNewGame(GameLevel currentLevel)
 {
     mineSweeper = new MineSweeperBLT();
     mineSweeper.StartGame(currentLevel);
     InitiateButtons();
     DrawButtons();
     gameOver = false;
 }
示例#20
0
 public void ReturnToSongSelectionScreen()
 {
     SongSelectionScreen selectionScreen = new SongSelectionScreen(songs.ToArray(), skin, graphics.GraphicsDevice);
     selectionScreen.SongSelected += new SongSelectionScreen.SongSelectedEventHandler(SongSelected);
     selectionScreen.ExitGame += delegate() { this.Exit(); };
     level = null;
     currentScreen = selectionScreen;
 }
示例#21
0
        public void LevelEndedPlayerLost(GameLevel gameLevel)
        {
            // Again a fugly way of doing this.
            // Re-initialize current game pahse.
            int currentIndex = _gamePhases.Values.ToList().IndexOf(_activeGamePhase);

            ChangeActiveGamePhase(_gamePhases.Keys.ToList()[currentIndex]);
        }
        public override void Render(GBitmap screen)
        {
            screen.Fill(175, 0, 0, 0);

            Modes mode        = GameLevel.GetMode();
            int   colWidth    = 195;
            int   nameColSx   = screen.ScreenWidth / 2 - colWidth / 2;
            int   killsColSx  = nameColSx + 100;
            int   deathsColSx = killsColSx + 50;
            int   yo          = 20;

            GFont.WriteXCenter(screen, "statistics", 2, yo);
            yo += 40;

            if (mode == Modes.Deathmatch)
            {
                RenderColTitle(screen, ref yo, nameColSx, killsColSx, deathsColSx);

                foreach (Player player in Players)
                {
                    RenderPlayer(screen, ref yo, player.Name, player.Kills, player.Deaths, nameColSx, killsColSx, deathsColSx);
                }
            }
            else
            {
                int xo     = -(screen.ScreenWidth - colWidth) / 4 - 15;
                int col2Yo = yo;

                GFont.Write(screen, "team of blu", 1, nameColSx + xo, yo);
                yo += 20;

                RenderColTitle(screen, ref yo, nameColSx + xo, killsColSx + xo, deathsColSx + xo);

                foreach (Player player in Players)
                {
                    if (player.Team == Teams.Blu)
                    {
                        RenderPlayer(screen, ref yo, player.Name, player.Kills, player.Deaths, nameColSx + xo, killsColSx + xo, deathsColSx + xo);
                    }
                }

                xo = -1 * xo;
                yo = col2Yo;

                GFont.Write(screen, "team of red", 1, nameColSx + xo, yo);
                yo += 20;

                RenderColTitle(screen, ref yo, nameColSx + xo, killsColSx + xo, deathsColSx + xo);

                foreach (Player player in Players)
                {
                    if (player.Team == Teams.Red)
                    {
                        RenderPlayer(screen, ref yo, player.Name, player.Kills, player.Deaths, nameColSx + xo, killsColSx + xo, deathsColSx + xo);
                    }
                }
            }
        }
	/// <summary>
	/// Updates the view for new level.
	/// </summary>
	/// <param name="level">Level.</param>
	public void UpdateViewForNewLevel (GameLevel level, GameState state)
	{
		ClearRemainingEma ();
		LayoutEmaGrid (level.Layout, state);
		context.UIComponents.LevelText.text = string.Format (context.ConfigurableSettings.MessageLevelPattern, level.LevelDesignation);
		context.UIComponents.ScoreText.text = string.Format (context.ConfigurableSettings.MessageScorePattern, 0, level.EmaCount);
		context.UIComponents.BallsText.text = string.Format (context.ConfigurableSettings.MessageBallPattern, level.BallCount, level.BallCount);
		UpdateAtmosphere (state);
	}
示例#24
0
 /// <summary>
 /// Замена конструктора, процедура инициализации компонента
 /// </summary>
 /// <param name="parEntGameObject">Родительский игровой объект</param>
 /// <param name="parStartLevel">Стартовый уровень для начала игры</param>
 public new GameSessionControllerComponent Init(GameObject parEntGameObject, GameLevel parStartLevel)
 {
     base.Init(parEntGameObject, false, true);
     Console.WriteLine("Starting game session...");
     _actualPlayer = new Player(parEntGameObject.LinkedAppModel.GetPlayersManager().Player1, 0, LIVES_COUNT_START);
     //StartLevel(startLevel);
     _startingLevel = parStartLevel;
     return(this);
 }
        public Entry Get(GameLevel level, GameResult result)
        {
            if (Entries.TryGetValue(new Origin(level, result), out Entry e))
            {
                return e;
            }

            return null;
        }
        public override void EnterState(GameLevel gameController)
        {
            base.EnterState(gameController);

            foreach (SkyPlayer existingPlayer in gameController.GetPlayers())
            {
                existingPlayer.UpdateGameMode(GameMode.Adventure, true);
            }
        }
示例#27
0
 public void NextLevel()
 {
     Console.Clear();
     if (Level == GameLevel.FIRST)
     {
         Level = GameLevel.SECOND;
     }
     LoadLevel();
 }
示例#28
0
        public Entry Get(GameLevel level, GameResult result)
        {
            if (this.Entries.TryGetValue(new Origin(level, result), out Entry e))
            {
                return(e);
            }

            return(null);
        }
 public void Init(int zoneNumber, int levelNum, GameLevel level)
 {
     Init($"{levelNum + 1}", () =>
     {
         currentLevel.SelectLevel(level, zoneNumber, levelNum);
         isLevelStart.Value = true;
         Message.Publish(new StartDemoLevelRequested());
     }, level, true);
 }
示例#30
0
    private void UpdateLevelCheck()
    {
        GameLevel newLevel = GameLevelMaker.GetLevel(score);

        if (!newLevel.Equals(gameLevel))
        {
            UpdateLevelStuff(newLevel);
        }
    }
示例#31
0
 private void InitGame()
 {
     if (GameLevel.GetMode() == Modes.Deathmatch)
     {
         TeamNotSelected = false;
     }
     this.PausePopUp = new Pause(Input);
     StartPlaying();
 }
示例#32
0
    void OnEnable()
    {
        CurrentLevel = this;

        if (persistentObjects == null)
        {
            persistentObjects = new PersistableObject[0];
        }
    }
示例#33
0
        /// <summary>
        /// 移除已注册的关卡
        /// </summary>
        /// <param name="path">文件路径</param>
        public void RemoveLevel(string path)
        {
            GameLevel level = FindLevel(path);

            if (level != null)
            {
                gameLevels.Remove(level);
            }
        }
示例#34
0
    private void Start()
    {
        audio = GetComponent <AudioController>();
        audio.Play();

        levelComp = GetComponent <GameLevel>();
        level     = PlayerPrefs.GetInt("level", 0);
        GenerateLevel();
    }
示例#35
0
 void RemoveLevel()
 {
     if (level)
     {
         level.StopGameLevel();
         Destroy(level);
         level = null;
     }
 }
        public static string GetGameLevelAssetFileDirectory(GameLevel level)
        {
            GameLevelToolkitWindow toolkit = GameLevelToolkitWindow.GetRefreshedToolkitWindow();
            string projectDirectory        = GameLevelToolkitWindow.GetProjectPathStringWithSlash();

            string gameLevelDirectory = "Assets/" + projectDirectory + "Resources/" + SceneAndResourceFolderName.folderNameValue + "/" + "Existing " + SceneAndResourceFolderName.folderNameValue + "/" + level.name + ".asset";

            return(gameLevelDirectory);
        }
示例#37
0
    void PickUpAllPyramids()
    {
        GameLevel gameLevel = (GameLevel)target;

        foreach (Pyramid pyramid in gameLevel.pyramids)
        {
            pyramid.PickUp();
        }
    }
示例#38
0
        public override void LeaveState(GameLevel gameLevel)
        {
            foreach (Entity entity in _spawnedEntities)
            {
                entity.DespawnEntity();
            }

            _spawnedEntities.Clear();
        }
示例#39
0
 // Use this for initialization
 void Start()
 {
     CreateMap(Map1);
     doorActive      = false;
     Instance        = this;
     gameLevel       = GameLevel.level1;
     gameState       = GameState.inPlay;
     characterSprite = playerController.GetComponentInChildren <SpriteRenderer> ();
 }
        /// <summary>
        /// Changes the current level
        /// </summary>
        /// <param name="level">the level we want to change to</param>
        public void ChangeLevel(GameLevel level)
        {
            currentLevel = level;
            currentLevel.Initialize();
            GameLevel temp = (GameLevel)currentLevel;

            temp.InitializeCam(viewport);
            currentLevel.LoadContent();
        }
    //retrieve data by finding the matching element in the level save data list
    public static LevelSaveData GetLevelData(GameLevel level)
    {
        GlobalSaveData globalSaveData = GameManager.instance.globalSaveData;

        List <LevelSaveData> levelSaveDataList = new List <LevelSaveData>(globalSaveData.levelSaveData);
        LevelSaveData        data = levelSaveDataList.Where(obj => obj.dataName == level.levelName).SingleOrDefault();

        return(data);
    }
示例#42
0
        private void DuplicateLevel()
        {
            if (HasNewLocationNameAssigned() == true)
            {
                Debug.LogError("Has No New Location Name Assigned");
                return;
            }

            if (gameLevelToCreateDuplicateOf == null)
            {
                Debug.LogError("Location Required to Duplicate");
                return;
            }

            GameLevelToolkitWindow toolkit = GameLevelToolkitWindow.GetRefreshedToolkitWindow();
            string projectPathName         = GameLevelToolkitWindow.GetProjectPathStringWithSlash();

            //Check if there is a location already existing with that name.
            GameLevel existingGameLevel = (GameLevel)AssetDatabase.LoadAssetAtPath("Assets/" + projectPathName + "Resources/" + SceneAndResourceFolderName.folderNameValue + "/" + newGameLevelName + "/" + newGameLevelName + ".asset", typeof(GameLevel));

            if (existingGameLevel != null)
            {
                Debug.LogError("Location With Same Name Already Exists");
                return;
            }

            //Create the Location Resource
            GameLevel gameLevelResource = GameLevelData.CreateInstance <GameLevel>();

            AssetDatabase.CreateAsset(GameLevel.CreateInstance <GameLevel>(), "Assets/" + projectPathName + "Resources/" + SceneAndResourceFolderName.folderNameValue + "/" + "Existing " + SceneAndResourceFolderName.folderNameValue + "/" + newGameLevelName + ".asset");
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
            GameLevel createdGameLevel = (GameLevel)AssetDatabase.LoadAssetAtPath("Assets/" + projectPathName + "Resources/" + SceneAndResourceFolderName.folderNameValue + "/" + "Existing " + SceneAndResourceFolderName.folderNameValue + "/" + newGameLevelName + ".asset", typeof(GameLevel));

            createdGameLevel.gameLevelName           = newGameLevelName;
            createdGameLevel.assignedScenesDirectory = "Assets/" + projectPathName + "Scenes/" + SceneAndResourceFolderName.folderNameValue + "/" + newGameLevelName;
            createdGameLevel.levelDependencies       = gameLevelToCreateDuplicateOf.levelDependencies;
            createdGameLevel.assignedScenes          = gameLevelToCreateDuplicateOf.assignedScenes;
            GameLevelToolkitWindow.GetGameLevelsData().gameLevelsCreatedByUser.Add(createdGameLevel);

            //Create the Scene Directory
            string scenesFolder = AssetDatabase.CreateFolder("Assets/" + projectPathName + "Scenes/" + SceneAndResourceFolderName.folderNameValue, newGameLevelName);

            //Copy the Existing Scenes
            for (int i = 0; i < gameLevelToCreateDuplicateOf.assignedScenes.Count; i++)
            {
                string sceneToCopy = gameLevelToCreateDuplicateOf.assignedScenesDirectory + "/" + gameLevelToCreateDuplicateOf.gameLevelName + "_" + gameLevelToCreateDuplicateOf.assignedScenes[i] + ".unity";
                string destination = createdGameLevel.assignedScenesDirectory + "/" + newGameLevelName + "_" + gameLevelToCreateDuplicateOf.assignedScenes[i] + ".unity";
                FileUtil.CopyFileOrDirectory(sceneToCopy, destination);
            }

            EditorUtility.SetDirty(createdGameLevel);
            EditorUtility.SetDirty(toolkit.gameLevelsData);

            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }
        public override void TakeHit(XSonic.Characters.Sonic hitter, GameLevel level, out bool blocking)
        {
            // create life mushroom and deactivate
            blocking = true;
            active = false;

            LifeMushroom temp = new LifeMushroom(new Vector2(this.Location.X, this.Location.Y + 48), new Vector2(48, 48));
            temp.ParentLevel = level;
            level.AddObjects.Add(temp);
        }
示例#44
0
        private int typeOfDrawing; //0: Col & vision, 1: Col only, 2: vision only, 3: Hunter Spawn, 4: Supernatural Spawn, 5: Item Spawn, 6: Portal

        #endregion Fields

        #region Constructors

        public NewLevel(GameLevel tmpLevel)
        {
            InitializeComponent();
            this.fdOpen.InitialDirectory = Application.StartupPath + "\\data\\";
            this.currentLevel = tmpLevel;
            initializeGameArea();
            initializeBoxes();
            t = new Thread(update);
            startThreading();
        }
        public override void TakeHit(Sonic hitter, GameLevel level, out bool blocking)
        {
            blocking = true;
            hitter.Coins++;
            active = false;
            MovingAnchoredAnimation maa = new MovingAnchoredAnimation(3.0f, new Point[] { new Point((int)this.Location.X, (int)this.Location.Y+48), new Point((int)this.Location.X, (int)this.Location.Y + 144) }, 16, 0, 3, 0, 48, 48, Coin.SpinCoin, true);

            (XSonicGame.CurrentGame.Services.GetService(typeof(AnimationManager)) as AnimationManager).Add(maa);
            (XSonicGame.CurrentGame.Services.GetService(typeof(AudioManager)) as AudioManager).PlaySound("coins");
        }
示例#46
0
        private GameLevel ChangeLevel()
        {
            _totalPointsCollected += _pointsCollectedThisLevel;
            _pointsCollectedThisLevel = 0;

            Array values = Enum.GetValues(typeof(GameLevel));
            Random random = new Random();
            _currentLevel = (GameLevel)values.GetValue(random.Next(values.Length));
            return _currentLevel;
        }
示例#47
0
 public void BuildGameMap(Player player, GameLevel level)
 {
     this.level = level;
     BuildMap(null);
     CentreCamera();
     BuildContent(null);
     BuildPlayerAvatar(player, null);
     BuildNPC(level);
     BuildAffector(null);
 }
示例#48
0
 public void BuildGameMap(Player player, JsonSavedGame savedGame)
 {
     this.level = savedGame.Level;
     BuildMap(savedGame.Map);
     CentreCamera();
     BuildContent(savedGame.Map);
     BuildPlayerAvatar(player, savedGame.Player);
     BuildNPC(level, savedGame.NPCList);
     BuildAffector(savedGame.Map.DrugAffect);
 }
示例#49
0
    private void OnEnd_Level(GameLevel level) {
   
        switch (level) {
            case GameLevel.menu:

                break;

            case GameLevel.playLevel: 
                break;
        }
    }
示例#50
0
 /// <summary>
 /// This method helps to decide, whether the player gained a new record on a given level.
 /// </summary>
 /// <param name="level">The game was played on this level.</param>
 /// <param name="time">The gameplay time.</param>
 /// <returns>True, if on the given level the time is a new record.</returns>
 public bool IsNewRecord(GameLevel level, int time)
 {
     if (this.results.ContainsKey(level) && this.results[level].Item1 < time)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
示例#51
0
    //! Function to spawn a level
    private void SpawnLevel(GameLevel newLevel)
    {

        // If there is currently a level in play then destroy it
        if (currentLevel != null)
        {
            Destroy(currentLevel);
        }
        // Instantiate the desired level prefab
        currentLevel = Instantiate(LevelPrefabs[(int)newLevel], transform.position, transform.rotation) as GameObject;
    }
示例#52
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load textures
            Block.Texture = Content.Load<Texture2D>("BlockTexture");
            Bat.Texture = Content.Load<Texture2D>("BatTexture");
            Ball.Texture = Content.Load<Texture2D>("BallTexture");

            gameLevel = new GameLevel(spriteBatch.GraphicsDevice.PresentationParameters.BackBufferWidth, spriteBatch.GraphicsDevice.PresentationParameters.BackBufferHeight); // ToDo: Read screen dimensions
        }
示例#53
0
        public SudokuTable(GameLevel difficulty, uint tableNumPlayer)
        {
            m_gameStarted = false;
            m_gameEnded = false;

            m_tableID = LASTTABLEID++;
            m_tableNumPlayer = tableNumPlayer;
            m_difficultyLevel = difficulty;
            SudokuGeneratorIF generator = SudokuFactory.getInstance().createGenerator(difficulty);
            m_sudokuGrid = generator.generate();

            m_players = new Dictionary<uint, PlayerTable>();
        }
示例#54
0
    private void OnStart_Level(GameLevel level) {
        switch (level) {
            case GameLevel.menu:
                currentPlayLevel = 0;
                SceneManager.LoadScene(MENU_LEVEL);
                break;

            case GameLevel.playLevel:
                if (!GoToNextPlayLevel()) {
                    currentPlayLevel = 0;
                    GoToNextPlayLevel();
                }
                break;
        }
    }
示例#55
0
    public void LoadGameLevel(GameLevel level)
    {
        mGameLevel = level;

        switch (level) {
        case(GameLevel.kMenu):
            Application.LoadLevel("MenuLevel");
            break;
        case(GameLevel.kLevel1):
            Application.LoadLevel("PowerOverwhelming_mp4_level1");
            break;
        case(GameLevel.kLevel2):
            Application.LoadLevel("PowerOverwhelming_mp4_level2");
            break;
        }
    }
示例#56
0
        /// <summary>
        /// If parameters define a new record, then it will be added to the top list.
        /// </summary>
        /// <param name="level">The game was played on this level.</param>
        /// <param name="time">The gameplay time.</param>
        /// <param name="recordHolderName">The player's name, who gained the new record.</param>
        /// <returns>True if parameters defined a new record and it has been added to the top list.</returns>
        public bool AddNewRecord(GameLevel level, int time, string recordHolderName)
        {
            if (this.IsNewRecord(level, time))
            {
                var newRecord = new Tuple<int, string>(time, recordHolderName);

                // Remove old record.
                this.results.Remove(level);
                this.results.Add(level, newRecord);

                return true;
            }
            else
            {
                return false;
            }
        }
示例#57
0
    //    public Map(int rows, int columns)
    //    {
    //        rowNum = rows;
    //        columnNum = columns;
    //        mapGrid = new GameObject[rowNum,columnNum];
    //    }
    void Start()
    {
        gameLevel = GameLevel.level0;
        rowNum = gameLevel.rowNum;
        columnNum = gameLevel.columnNum;
        mapGrid = new GameObject[rowNum,columnNum];

        for (int rowIndex=0;rowIndex<rowNum-1 ;rowIndex++ )
        {
            for (int columnIndex=0;columnIndex<columnNum-1 ;columnIndex++ )
            {
                //���ɵ�ͼ����
                GameObject temp = (GameObject)Instantiate((GameObject)ground);
                temp.transform.parent = goundController.transform;
                temp.transform.localPosition = new Vector3(i*2f,j*2f,0f) + offset;
                if(i%2==0)
                    temp.transform.localRotation = Quaternion.AngleAxis (90f,Vector3.forward);
            }
        }
    }
示例#58
0
 public void StartSong(GameLevel level)
 {
     switch (level)
     {
         case GameLevel.Jazz:
             _activeAudioSource = _jazzAudioSource;
             break;
         case GameLevel.Classic:
             _activeAudioSource = _classicalAudioSource;
             break;
         case GameLevel.Electronic:
             _activeAudioSource = _electronicAudioSource;
             break;
         case GameLevel.Metal:
             _activeAudioSource = _metalAudioSource;
             break;
     }
     _activeAudioSource.Play();
     _songPlaying = true;
     _remainingTime = 30f;
 }
示例#59
0
        public void createTable(PlayerObserver player, GameLevel difficulty, uint numberPlayer)
        {
            lock (tableLock)
            {
                uint playerID = player.ThisPlayer.PlayerID;
                foreach (var item in m_tables)
                {
                    if (item.Value.isPlayerJoinedThisTable(playerID))
                    {
                        // informer le joueur qu'il ne peut joindre 2 table en même temps
                        player.SocketClient.sendPacket(new PDError(0, "Impossible de joindre 2 table en même temps"));
                        return;
                    }
                }

                SudokuTable st = new SudokuTable(difficulty, numberPlayer);
                m_tables.Add(st.TableID, st);
                st.jointTable(player);
                TableInserted(st);
            }
        }
 public GameLevelStructure(GameLevel difficulty)
 {
     this.Level = difficulty;
     switch (this.Level)
     {
         case GameLevel.Easy:
             this.GameBoardSize = 10;
             this.NumOfMines = 10;
             break;
         case GameLevel.Medium:
             this.GameBoardSize = 20;
             this.NumOfMines = 50;
             break;
         case GameLevel.Hard:
             this.GameBoardSize = 30;
             this.NumOfMines = 100;
             break;
         default:
             throw new System.ArgumentOutOfRangeException(
                 "difficulty",
                 "Unknown difficulty");
     }
 }