Example #1
0
        /*
            Game
        */
        // Expected time in seconds that a player is expected to complete this game
        public static int GameExpectedTime(GameTypes type, GameDifficulty difficulty)
        {
            double factor;

            switch (difficulty) {
            case GameDifficulty.Easy:
                factor = 1.3;
                break;
            case GameDifficulty.Master:
                factor = 0.7;
                break;
            case GameDifficulty.Medium:
            default:
                factor = 1.0;
                break;
            }

            switch (type) {
            case GameTypes.Memory:
                return (int) (30 * factor);
            case GameTypes.Calculation:
                return (int) (60 * factor);
            case GameTypes.VerbalAnalogy:
                return (int) (30 * factor);
            }
            return (int) (120 * factor); // Default for all games (logic)
        }
Example #2
0
 public static void ResetGameStats(GameDifficulty difficulty)
 {
     Player1Score = 0;
     Player2Score = 0;
     CurrentGameDifficulty = difficulty;
     WinningPlayer = null;
 }
Example #3
0
        public LogicItem(GameDifficulty difficulty,ContentManager Content)
        {
            content = Content;
            timer = 0.0f;
            timerFarting = 0.0f;

            backupSpeedRange = new Vector2(0,0);

            switch (difficulty)
            {
                case GameDifficulty.Easy:
                    speedRange = new Vector2(-80,80);
                    stepGenerationItems = 5;
                    stepGenerationWaste = 15;
                    break;
                case GameDifficulty.Normal:
                    speedRange = new Vector2(-110,110);
                    stepGenerationItems = 10;
                    stepGenerationWaste = 25;
                    break;
                case GameDifficulty.Hard:
                    speedRange = new Vector2(-170,170);
                    stepGenerationItems = 17;
                    stepGenerationWaste = 35;
                    break;
            }
        }
        public void Launch(string segueId, GameMode mode, GameDifficulty difficulty, Filter filter)
        {
            SegueId = segueId;
              SelectedMode = mode;
              SelectedDifficulty = difficulty;
              SelectedFilter = filter;

              if (SelectedFilter == null)
              {
            SelectedFilter = new Filter("0", "Siphon filter", "defaultIcon");
              }

              UIViewController.InvokeInBackground(() => {
            int gamesCount = SelectedFilter.Load();

            mController.BeginInvokeOnMainThread(() => {
              if (gamesCount < 30)
              {
            Dialogs.ShowDebugFilterTooRestrictive();
              }
              else
              {
            mController.PerformSegue(SegueId, mController);
              }
            });
              });
        }
        public static void Init(ContentManager Content)
        {
            difficulty = GameDifficulty.Easy; //DEFAULT AT THE MOMENT
            enemy.Load(Content);
            Enemy temp = new Enemy();
            temp.Init();
            temp.Load(Content);
            e.Add(temp);

            wire.Clear();
            Wire w1 = new Wire();
            w1.Init(new Vector2(0, 650));
            w1.Load(Content);
            wire.Add(w1);
            Wire w2 = new Wire();
            w2.Init(new Vector2(0, 610));
            w2.Load(Content);
            wire.Add(w2);
            Wire w3 = new Wire();
            w3.Init(new Vector2(0, 570));
            w3.Load(Content);
            wire.Add(w3);

            gameState = GameState.menu;

            UserInt.UIInitialise();
        }
Example #6
0
        public LogicPolygon(GameDifficulty Difficulty,ContentManager Content)
        {
            this.content = Content;
            this.difficulty = Difficulty;

            positionPoly = new Vector3(-1200,-900,-750);
        }
Example #7
0
        public static void AddScore(GameDifficulty difficulty, HighScore newItem)
        {
            switch (difficulty)
              {
            case GameDifficulty.Easy:
              Current.easyHighScores.Add(newItem);
              Current.easyHighScores = Current.easyHighScores.OrderByDescending(h => h.score).Take(6).ToList();
              break;
            case GameDifficulty.Normal:
              Current.mediumHighScores.Add(newItem);
              Current.mediumHighScores = Current.mediumHighScores.OrderByDescending(h => h.score).Take(6).ToList();
              break;
            case GameDifficulty.Hard:
              Current.hardHighScores.Add(newItem);
              Current.hardHighScores = Current.hardHighScores.OrderByDescending(h => h.score).Take(6).ToList();
              break;
              }

              var IS = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication();
              try
              {
            using (var f = IS.CreateFile(highScoresPath))
            {
              var serializer = new XmlSerializer(typeof(HighScores));
              serializer.Serialize(f, Current);
            }

              }
              catch (Exception)
              {
              }
        }
Example #8
0
 public LogicState(GameDifficulty difficulty, ContentManager Content)
     : base(difficulty,Content)
 {
     this.difficulty = difficulty;
      totalGameTime = 0.0;
      score = 0;
 }
 public GameOptions(GameDifficulty gameDifficulty, GameSurvivor gameSurvivor, Boolean autoReload, Boolean weaponsUnlocked)
 {
     this.GameDifficulty = gameDifficulty;
     this.GameSurvivor = gameSurvivor;
     this.AutoReload = autoReload;
     this.WeaponsUnlocked = weaponsUnlocked;
 }
Example #10
0
 public ScoreEntry(String PlayerName, int Score, int Wave, GameDifficulty Difficulty, String MapName)
 {
     this.PlayerName = PlayerName;
     this.Score = Score;
     this.MapName = MapName;
     this.Difficulty = Difficulty;
     this.Wave = Wave;
 }
Example #11
0
        List<int> play_list; // Play list for the Selected difficulty, game types

        #endregion Fields

        #region Constructors

        public GameSessionPlayList(GameManager manager)
        {
            this.manager = manager;
            play_list = new List <int> ();
            game_type = GameSession.Types.AllGames;
            difficulty = GameDifficulty.Medium;
            RandomOrder = true;
            dirty = true;
        }
Example #12
0
        List<int> play_list; // Play list for the Selected difficulty, game types

        #endregion Fields

        #region Constructors

        public GameManager()
        {
            game_type = GameSession.Types.None;
            difficulty = GameDifficulty.Medium;
            available_games = new List <GameLocator> ();
            play_list = new List <int> ();
            cnt_logic = cnt_memory = cnt_calculation = cnt_verbal = 0;
            RandomOrder = true;
        }
        public GamePlayScreen(GameDifficulty diff)
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            isFirstLevel = true;
            this.diff = diff;

            random = new Random();
        }
        public GamePlayScreen(GameDifficulty diff)
        {
            TransitionOnTime  = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            isFirstLevel = true;
            this.diff    = diff;

            random = new Random();
        }
Example #15
0
 public AlphaBot(bool pindle, bool eld, bool shenk, DataManager dm, String bnetServer, String account, String password, String classicKey, String expansionKey, uint potlife, uint chickenlife, String binaryDirectory, GameDifficulty difficulty, String gamepass)
     : base(dm,bnetServer,account,password,classicKey,expansionKey,potlife,chickenlife,binaryDirectory,difficulty,gamepass)
 {
     Pindle = pindle;
     Eldritch = eld;
     Shenk = shenk;
     m_redPortal = new Entity();
     m_harrogathWp = new Entity();
     m_act1Wp = new Entity();
 }
Example #16
0
        public CountingData CountCard(PlayerType type, CardView card, GameDifficulty diffuculty)
        {
            Player player = GetPlayer(type);


            if (_countingPhase == null)
            {
                //
                //  get a state machine to for the counting phase
                _countingPhase = new CountingPhase(_player, _player.Hand.Cards, _computer, _computer.Hand.Cards);
            }

            // MainPage.LogTrace.WriteLogEntry("in countcard.  Turn is: {0}", _countingPhase.State.TurnPlayer.Name);

            CountingData data = new CountingData();

            Player playThisTurn = _countingPhase.State.TurnPlayer;
            Player playNextTurn = _countingPhase.State.NextTurnPlayer;

            if (playThisTurn.Type != type)
            {
                Debug.Assert(false, "Wrong turn encountered");
                //throw new Exception("Not your turn!");
            }

            CountingState state = _countingPhase.PlayCard(playThisTurn, card, diffuculty);


            data.Score                = state.LastScore;
            data.CurrentCount         = state.Count;
            data.ResetCount           = state.ResetCount;
            data.CardId               = card.Index;
            data.CardName             = card.CardName;
            data.isGo                 = state.isGo;
            data.NextPlayer           = state.TurnPlayer.Type;
            data.NextPlayerId         = state.TurnPlayer.ID;
            data.NextPlayerCanGo      = state.NextPlayerCanGo;
            data.ThisPlayerCanGo      = state.ThisPlayerCanGo;
            data.CardsCounted         = state.CardsCounted;
            data.ScoreStory           = state.ScoreStory;
            data.NextPlayerIsComputer = (state.TurnPlayer.Type == PlayerType.Computer);
            data.CountBeforeReset     = state.CountBeforeReset;

            if (data.CardsCounted == 8)
            {
                _countingPhase = null;
            }
            else
            {
                _countingPhase.State.ResetCount = false;
                _countingPhase.State.isGo       = false;
            }

            return(data);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="now"></param>
        /// <returns></returns>
        /// <remarks>It can't go beyond Hard</remarks>
        public static GameDifficulty GetNext(GameDifficulty now)
        {
            switch (now)
            {
            case GameDifficulty.EASY:  return(GameDifficulty.MEDIUM);

            case GameDifficulty.MEDIUM: return(GameDifficulty.HARD);

            default: return(GameDifficulty.HARD);
            }
        }
Example #18
0
    void Start()
    {
        // Spawn the three NPC characters
        SpawnNpc(_alicePrefab);
        SpawnNpc(_rupertPrefab);
        SpawnNpc(_mindyPrefab);
        SpawnNpc(_chadPrefab);

        string d = SettingsController.instance.GetDifficulty();

        if (d.Contains("Easy"))
        {
            _difficulty = GameDifficulty.Easy;
            _maxPoints  = 100;
            _timer      = 40f;
        }
        else if (d.Contains("Medium"))
        {
            _difficulty = GameDifficulty.Medium;
            _maxPoints  = 200;
            _timer      = 80f;
        }
        else if (d.Contains("Hard"))
        {
            _difficulty = GameDifficulty.Hard;
            _maxPoints  = 300;
            _timer      = 120f;
        }
        else
        {
            _difficulty = GameDifficulty.TimeAttack;
            _timer      = 60f;
            _maxPoints  = 900;
        }

        _timerLabel.text        = ((int)_timer).ToString();
        _scareSlider.fillAmount = 0f;

        if (_difficulty == GameDifficulty.TimeAttack)
        {
            GetComponent <AudioSource>().clip = _loopMusic;
            _pointsLabel.text = "0";
        }
        else
        {
            GetComponent <AudioSource>().clip = _music;
            _pointsLabel.text = "0 / " + _maxPoints.ToString();
        }

        if (SettingsController.instance.PlayMusic())
        {
            GetComponent <AudioSource>().Play();
        }
    }
Example #19
0
        private static bool HandleChangeDifficultyEvent(NwPlayer dungeonMaster, CNWSMessage message)
        {
            GameDifficulty       difficulty = (GameDifficulty)message.PeekMessage <int>(0);
            OnDMChangeDifficulty eventData  = ProcessEvent(new OnDMChangeDifficulty
            {
                DungeonMaster = dungeonMaster,
                NewDifficulty = difficulty,
            });

            return(!eventData.Skip);
        }
Example #20
0
 public GameViewModel()
 {
     this.currentState      = ViewState.Menu;
     this.isSettingFlag     = false;
     this.currentDifficulty = GameDifficulty.Beginner;
     this.gameStatus        = GameStatus.NotStarted;
     this.StartGameCommand  = new DelegateCommand <object>(this.StartGame, this.CanStartGame);
     this.EndGameCommand    = new DelegateCommand <object>(this.EndGame, this.CanEndGame);
     this.SetFlagCommand    = new DelegateCommand <object>(this.SetFlag, this.CanSetFlag);
     this.SelectTileCommand = new DelegateCommand <object>(this.SelectTile, this.CanSelectTile);
 }
        /// <summary>
        /// Automatically fill dropdown lists
        /// </summary>
        private void Start()
        {
            Debug.Assert(levels.Count > 0, "No levels Available");
            levelDropDown.ClearOptions();
            levelDropDown.AddOptions(levels);
            selectedLevel = levels[0];

            difficultyDropDown.ClearOptions();
            difficultyDropDown.AddOptions(Enum.GetNames(typeof(GameDifficulty)).ToList());
            selectedDifficulty = GameDifficulty.Normal;
        }
Example #22
0
 public ClassicMaze(int displayWidth, int displayHeight, IMazeGameHost host,
     UserProfile profile, GameDifficulty difficulty = GameDifficulty.Normal)
     : base(displayWidth, displayHeight, profile, difficulty)
 {
     timeScoreIncrement = 1.67;
     maxTimeScore = 1000;
     this.gameHost = host;
     timeToCompleteMaze = new TimeKeeper();
     itemManager = new ItemManager();
     camRow = null;
     camCol = null;
 }
Example #23
0
    //Constructor function for this class
    public PlayerProgress(GameData gameData_, TileMapManager tileGrid_, LevelUpManager levelUpManager_, CharacterManager charManager_, QuestTracker questTracker_)
    {
        //Setting the GameData.cs variables
        this.difficulty          = gameData_.currentDifficulty;
        this.allowNewUnlockables = gameData_.allowNewUnlockables;
        this.folderName          = gameData_.saveFolder;
        this.randState           = Random.state;

        //Setting the CreateTileGrid.cs variables
        this.gridCols = tileGrid_.cols;
        this.gridRows = tileGrid_.rows;

        //Setting the HUDChallengeRampUpTimer.cs variables
        this.currentDifficulty      = HUDChallengeRampUpTimer.globalReference.currentDifficulty;
        this.currentDifficultyTimer = HUDChallengeRampUpTimer.globalReference.currentTimer;

        //Setting the LevelUpManager variable
        this.characterLevel = levelUpManager_.characterLevel;

        //Setting the PartyGroup.cs variables
        this.partyGroup1 = new PartySaveData(PartyGroup.globalReference);

        //Looping through all of the dead character info in CharacterManager.cs
        this.deadCharacters = new List <DeadCharacterInfo>();
        for (int d = 0; d < charManager_.deadCharacters.Count; ++d)
        {
            this.deadCharacters.Add(charManager_.deadCharacters[d]);
        }

        //Looping through all of the enemy tile encounters in CharacterManager.cs
        this.enemyTileEncounters = new List <EnemyTileEncounterInfo>();
        for (int e = 0; e < CharacterManager.globalReference.tileEnemyEncounters.Count; ++e)
        {
            //Making sure the encounter isn't null first
            if (CharacterManager.globalReference.tileEnemyEncounters[e] != null)
            {
                //Creating a new tile encounter info for the enemy
                EnemyTileEncounterInfo enemyInfo = new EnemyTileEncounterInfo(CharacterManager.globalReference.tileEnemyEncounters[e]);
                //Adding the enemy encounter info to our list to serialize
                this.enemyTileEncounters.Add(enemyInfo);
            }
        }

        //Looping through all of the quests in our quest log
        this.questLog = new List <string>();
        foreach (Quest q in questTracker_.questLog)
        {
            this.questLog.Add(JsonUtility.ToJson(new QuestSaveData(q), true));
        }

        //Saving all of the finished quest names
        this.finishedQuests = questTracker_.completedQuestNames;
    }
        public MainGameComponent(Game game, bool forceNewGame, GameDifficulty difficulty)
            : base(game)
        {
            TouchPanel.EnabledGestures = GestureType.Tap | GestureType.FreeDrag | GestureType.DragComplete;

              PhoneApplicationService.Current.Closing += (s, e) => SaveGameState();
              PhoneApplicationService.Current.Deactivated += (s, e) => SaveGameState();
              if (forceNewGame)
              gameState = new GameState(difficulty);
              else
              gameState = CreateOrResumeState(difficulty);
        }
        /// <summary>
        /// Sets the records for a mode and difficulty.
        /// </summary>
        /// <param name="mode">Mode.</param>
        /// <param name="difficulty">Difficulty.</param>
        /// <param name="currentRank">Current rank.</param>
        /// <param name="currentScore">Current score.</param>
        public void SetRecords(GameMode mode, GameDifficulty difficulty, int? currentRank = null, int? currentScore = null)
        {
            this._mode = mode;
              this._difficulty = difficulty;
              this._currentRank = currentRank;
              this._currentScore = currentScore;

              if (IsViewLoaded)
              {
            SetValues();
              }
        }
Example #26
0
        protected virtual void CreateGame(string Name, GameDifficulty Difficulty, byte MaxPlayers, string Description = "", string Password = "")
        {
            this.Realm.WriteToLog("Creating Game: " + Name, Color.Orange);
            this.Realm.WaitForPacket(3);
            CreateGameRequest packet = new CreateGameRequest(this.ReqID, Difficulty, 8, Name, Password, Description);

            this.Realm.SendPacket(packet);
            checked
            {
                this.ReqID += 1;
            }
        }
Example #27
0
    public void GameStart(GameDifficulty difficulty)
    {
        SceneManager.LoadScene(2, LoadSceneMode.Single);

        score              = 0u;
        Cursor.lockState   = CursorLockMode.Locked;
        gameDifficulty     = difficulty;
        controllableBehave = FindObjectOfType <ControllableBehave>();
        PlayBGM(bgmList.gameBGM);

        gameStatus = GameStatus.GameRunning;
    }
Example #28
0
    // ----- Initialization Functions -----
    private void Awake()
    {
        InitializeSingleton();

        gameDifficulty = SceneDataTransfer.CurrentGameDifficulty;
        InitializeDataMaps();
        lifeCount = initialLifeCounts[gameDifficulty];
        level     = 1;
        canvasController.InitializeGUI();

        InitializeGame();
    }
    public GameEntity SetGameDifficulty(GameDifficulty newState)
    {
        if (hasGameDifficulty)
        {
            throw new Entitas.EntitasException("Could not set GameDifficulty!\n" + this + " already has an entity with GameDifficultyComponent!",
                                               "You should check if the context already has a gameDifficultyEntity before setting it or use context.ReplaceGameDifficulty().");
        }
        var entity = CreateEntity();

        entity.AddGameDifficulty(newState);
        return(entity);
    }
Example #30
0
    void Start()
    {
        audioSource = GetComponent <AudioSource>();
        GameDifficulty diff      = DataAdapter.GameData.difficulty != null ? DataAdapter.GameData.difficulty : GameDifficulty.Easy;
        PlayerType     enemyType = DataAdapter.GameData.enemyType != null ?DataAdapter.GameData.enemyType: PlayerType.AI;

        Gc = DataAdapter.GameData.gameController != null ? DataAdapter.GameData.gameController : new GameController(diff, enemyType);
        Gc.SetDifficulty(diff);
        Gc.SetGameMode(enemyType);
        RedrawBoard(Gc.GetBoard());
        ChangeCurrentColor();
    }
Example #31
0
    private void Awake()
    {
        Application.targetFrameRate = 1000;
        Cursor.lockState            = CursorLockMode.Locked;
        Cursor.visible = false;
        instance       = this;

        difficulty = (GameDifficulty)Enum.Parse(typeof(GameDifficulty), PlayerPrefs.GetString("Difficulty", "Normal"));

        gameUI = FindObjectOfType <GameUI>();
        Resume();
    }
    void OnTriggerExit(Collider other)
    {
        if (other.tag == "Player")
        {
            return;
        }
        if (other.tag == "Grenade")
        {
            return;
        }

        if (other.transform.parent != null)
        {
            Destroy(other.transform.parent.gameObject);
            //1111111111
            if (Flight_CombatFlightController.instance != null)
            {
                if (Flight_CombatFlightController.instance.isFlicker.Equals(false))
                {
                    Flight_CombatFlightController.instance.hitCount           = 0;
                    Flight_CombatFlightController.instance.difficultyHitCount = 0;
                    dodgeCount++;
                    if (dodgeCount.Equals(1))
                    {
                        if (AdaptiveDifficultyManager.Instance != null)
                        {
                            AdaptiveDifficultyManager.Instance.SetUserTalent("OverObs", 40);
                        }
                    }
                    if (dodgeCount >= 2)
                    {
                        if (AdaptiveDifficultyManager.Instance != null)
                        {
                            AdaptiveDifficultyManager.Instance.SetUserTalent("OverObs2", 40);
                        }
                    }
                    difficultyDodgeCount++;
                    if (difficultyDodgeCount >= 2)
                    {
                        if (AdaptiveDifficultyManager.Instance != null)
                        {
                            GameDifficulty result = AdaptiveDifficultyManager.Instance.GetGameDifficulty("ObsFreq", 40);
                            if (Flight_StageController.Instance != null)
                            {
                                Flight_StageController.Instance.SetDifficultyFrequency(result);
                            }
                        }
                        difficultyDodgeCount = 0;
                    }
                }
            }
        }
    }
Example #33
0
    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        Debug.Log(scene.name + ": " + MusicTheme.themeName);
        if (MusicTheme.themeName == "")
        {
            SetMainMusicTheme(0);
        }
        if (CurrGameDifficulty.levelName == "")
        {
            CurrGameDifficulty = gameDifficulties[0];
        }

        GameObject gameDifficultyDropdownGameObject = GameObject.Find(Constants.GAME_DIFFICULTY_DROPDOWN);

        if (gameDifficultyDropdownGameObject != null)
        {
            gameDifficultyDropdown = gameDifficultyDropdownGameObject.GetComponent <Dropdown>();
            gameDifficultyDropdown.ClearOptions();
            List <string> gameDifficultyOptions = new List <string>();
            foreach (GameDifficulty gd in gameDifficulties)
            {
                gameDifficultyOptions.Add(gd.levelName);
            }
            gameDifficultyDropdown.AddOptions(gameDifficultyOptions);

            gameDifficultyDropdown.value = gameDifficulties.IndexOf(CurrGameDifficulty);

            gameDifficultyDropdown.onValueChanged.AddListener(delegate {
                SetGameDifficultyFromDropdownOptions(gameDifficultyDropdown.value);
            });
        }

        GameObject musicThemeDropdownGameObject = GameObject.Find(Constants.MUSIC_DROPDOWN);

        if (musicThemeDropdownGameObject != null)
        {
            musicThemeDropdown = musicThemeDropdownGameObject.GetComponent <Dropdown>();
            musicThemeDropdown.ClearOptions();
            List <string> musicThemeOptions = new List <string>();
            foreach (GameMusicTheme gmt in musicThemes)
            {
                musicThemeOptions.Add(gmt.themeName);
            }
            musicThemeDropdown.AddOptions(musicThemeOptions);

            musicThemeDropdown.value = musicThemes.IndexOf(MusicTheme);

            musicThemeDropdown.onValueChanged.AddListener(delegate {
                SetMainMusicTheme(musicThemeDropdown.value);
            });
        }
    }
Example #34
0
        public float ProgressByDifficulty(GameDifficulty difficulty)
        {
            var c = ByDifficulty(difficulty);

            if (c == null)
            {
                return(0);
            }

            var fullyCompleted = c.Sum(quest => quest.IsFullyCompleted ? 1 : 0);

            return(c.Count == 0 ? 1 : (fullyCompleted / (float)c.Count));
        }
        public override void ViewDidLoad()
        {
            mLastSelectedDifficulty = GameDifficulty.EASY;
              SliderDifficulty.Value = (float)GameDifficulty.EASY;

              ButtonYearMin.SetTitle(mCacheMinYear.ToString(), UIControlState.Normal);
              ButtonYearMax.SetTitle(mCacheMaxYear.ToString(), UIControlState.Normal);

              ButtonGenre.SetTitle("All", UIControlState.Normal);
              ButtonPlatform.SetTitle("All", UIControlState.Normal);

              base.ViewDidLoad();
        }
Example #36
0
        int ToRecursiveDepth(GameDifficulty difficulty)
        {
            switch (difficulty)
            {
            case GameDifficulty.EASY: return(1);

            case GameDifficulty.MEDIUM: return(2);

            case GameDifficulty.HARD: return(4);

            default: throw new ArgumentException("Unsupported game difficulty " + difficulty);
            }
        }
        public LevelCompleteScreen(Player player, GameDifficulty gd, float acc)
        {
            this.player = player;

            IsPopup = false;

            TransitionOnTime = TimeSpan.FromSeconds(0.2);
            TransitionOffTime = TimeSpan.FromSeconds(0.2);

            this.score = player.score;
            this.lives = player._lives;
            this.gameDiff = gd;
        }
Example #38
0
        public LevelCompleteScreen(Player player, GameDifficulty gd, float acc)
        {
            this.player = player;

            IsPopup = false;

            TransitionOnTime  = TimeSpan.FromSeconds(0.2);
            TransitionOffTime = TimeSpan.FromSeconds(0.2);

            this.score    = player.score;
            this.lives    = player._lives;
            this.gameDiff = gd;
        }
Example #39
0
        private static List <DynamiteScenario> getPossibleScenarios(GameDifficulty difficulty)
        {
            List <DynamiteScenario> result = new List <DynamiteScenario>();

            foreach (DynamiteScenario s in ALL_SCENARIOS)
            {
                if (s.Difficulty == difficulty)
                {
                    result.Add(s);
                }
            }
            return(result);
        }
Example #40
0
    // Use this for initialization
    public void Init(GameDifficulty d)
    {
        switch (d)
        {
        case GameDifficulty.Normal:
            _InitNormal();
            break;

        default:
            Debug.LogError("Chaos bag not impl!!");
            break;
        }
    }
Example #41
0
    private bool ValidateUserInput(string input)
    {
        var inputIsValid = Enum.TryParse(input, out GameDifficulty parsedDifficulty);

        if (!inputIsValid)
        {
            Terminal.WriteLine("You have to choose a difficulty level!");
            return(false);
        }

        difficulty = parsedDifficulty;
        return(true);
    }
    public void ReplaceGameDifficulty(GameDifficulty newState)
    {
        var entity = gameDifficultyEntity;

        if (entity == null)
        {
            entity = SetGameDifficulty(newState);
        }
        else
        {
            entity.ReplaceGameDifficulty(newState);
        }
    }
        public static ResistancePenaltyEnum GetPenaltyByGameDifficulty(GameDifficulty gameDifficulty)
        {
            switch (gameDifficulty)
            {
            case GameDifficulty.Nightmare:
                return(ResistancePenaltyEnum.Nightmare);

            case GameDifficulty.Hell:
                return(ResistancePenaltyEnum.Hell);

            default:
                return(ResistancePenaltyEnum.Normal);
            }
        }
Example #44
0
        void GameDifficultyClick(object sender, GameDifficulty difficulty)
        {
            Logger.Info($"Setting target difficulty to {difficulty}.");

            var clicked = (ToolStripMenuItem)sender;
            var parent  = (ToolStripMenuItem)clicked.OwnerItem;

            foreach (ToolStripMenuItem item in parent.DropDownItems)
            {
                item.Checked = item == clicked;
            }

            di.game.TargetDifficulty = difficulty;
        }
Example #45
0
        public GameModel(Map map, GameDifficulty difficulty)
        {
            SetDifficulty(difficulty);
            directionForBot.Add(0, Direction.East);
            directionForBot.Add(1, Direction.North);
            directionForBot.Add(2, Direction.South);
            directionForBot.Add(3, Direction.West);
            createBot[0] = new CreateBotDelegate(CreateEasyBot);
            createBot[1] = new CreateBotDelegate(CreateMediumBot);
            createBot[2] = new CreateBotDelegate(CreateHardBot);
            currentMap   = CreateMap(map);

            player.point = playerStartPosition = currentMap.startPosition;
        }
Example #46
0
        private void IntroScreen()
        {
            var gameInfo = new RogueBasin.GameIntro();

            gameInfo.ShowIntroScreen();

            difficulty = gameInfo.Difficulty;
            playerName = gameInfo.PlayerName;
            playItemMovies = gameInfo.ShowMovies;

              //  Game.Dungeon.Difficulty = GameDifficulty.Medium;
               //  Game.Dungeon.Player.Name = "Dave";
               //  Game.Dungeon.Player.PlayItemMovies = true;
        }
Example #47
0
    // Start is called before the first frame update
    void Start()
    {
        // Sort the waves by startTime
        waves        = waves.OrderBy(o => o.startTime).ToArray();
        medDifWaves  = medDifWaves.OrderBy(o => o.startTime).ToArray();
        hardDifWaves = hardDifWaves.OrderBy(o => o.startTime).ToArray();

        timer            = 0.0f;
        waveIndex        = medWaveIndex = hardWaveIndex = 0;
        nextWaveTime     = waves[0].startTime;
        medNextWaveTime  = medDifWaves[0].startTime;
        hardNextWaveTime = hardDifWaves[0].startTime;

        difficulty = GameSettings.Difficulty;

        if (GameSettings.Difficulty == GameDifficulty.UNSET && Application.isEditor)
        {
            difficulty = debugDifficulty;
        }


        switch (difficulty)
        {
        case GameDifficulty.EASY:
            triggerE = true;
            Debug.Log("Using difficulty EASY");
            break;

        case GameDifficulty.MEDIUM:
            triggerM = true;
            Debug.Log("Using difficulty MEDIUM");
            break;

        case GameDifficulty.HARD:
            triggerH = true;
            Debug.Log("Using difficulty HARD");
            break;

        default:
            triggerE = true;
            Debug.Log("Using difficulty DEFAULT/EASY");
            break;
        }

        winState = GameState.UNSTARTED;
        //lastUnpausedState = GameState.IN_PROGRESS;


        winMessage.SetActive(false);
    }
Example #48
0
 public SudokuGrid(GameDifficulty diff = GameDifficulty.Easy)
 {
     for (int i = 0; i < 3; i++)
     {
         for (int j = 0; j < 3; j++)
         {
             _arr[i, j] = new SubGrid();
         }
     }
     Init();
     Shuffle();
     _arrAnswer = ((SubGrid[, ])DeepClone(_arr));
     SetDifficulty(diff);
 }
Example #49
0
        private void IntroScreen()
        {
            var gameInfo = new RogueBasin.GameIntro();

            gameInfo.ShowIntroScreen();

            difficulty     = gameInfo.Difficulty;
            playerName     = gameInfo.PlayerName;
            playItemMovies = gameInfo.ShowMovies;

            //  Game.Dungeon.Difficulty = GameDifficulty.Medium;
            //  Game.Dungeon.Player.Name = "Dave";
            //  Game.Dungeon.Player.PlayItemMovies = true;
        }
        /// <summary>
        /// Simple Factory to determine what size of Matrix to initialize
        /// </summary>
        /// <param name="difficulty">The difficulty of the matrix</param>
        /// <returns>A Matrix of set difficulty</returns>
        public IMatrix SetDifficulty(GameDifficulty difficulty)
        {
            switch (difficulty)
            {
                case GameDifficulty.Easy:
                    this.matrixFactory = new FourSizedMatrixFactory();
                    break;
                case GameDifficulty.Hard:
                    this.matrixFactory = new FiveSizedMatrixFactory();
                    break;
            }

            return this.matrixFactory.CreateMatrix();
        }
Example #51
0
        void Awake()
        {
            NarratorUI = GameObject.Find("NarratorUI").transform.GetChild(0).gameObject;
            gd         = GameObject.Find("GameManager").GetComponent <GameManager>().getDifficulty();
            initializeUI();
            int runestoneIndex = UnityEngine.Random.Range(1, 7);

            while (runestoneIndex == 1 || runestoneIndex == 3)
            {
                //make sure won't happen at A and C
                runestoneIndex = UnityEngine.Random.Range(1, 7);
            }
            runestone = storyPoints[runestoneIndex - 1];
        }
 /// <summary>
 /// Creates a new game.
 /// </summary>
 /// <param name="input">The level of difficulty - easy, medium, hard, torture.</param>
 /// <returns>New game with the selected level of difficulty.</returns>
 public Game CreateGame(GameDifficulty input)
 {
     switch (input)
     {
         case GameDifficulty.Easy:
             return new Game(new GameField(GlobalConstants.EasyLevelRows, GlobalConstants.EasyLevelCols));
         case GameDifficulty.Medium:
             return new Game(new GameField(GlobalConstants.MediumLevelRows, GlobalConstants.MediumLevelCols));
         case GameDifficulty.Hard:
             return new Game(new GameField(GlobalConstants.HardLevelRows, GlobalConstants.HardLevelCols));
         default:
             return new Game(new GameField(GlobalConstants.TortureLevelRows, GlobalConstants.TortureLevelCols));
     }
 }
 public void SetDifficulty(GameDifficulty difficulty)
 {
     // used for difficulty presets
     switch (difficulty)
     {
         case GameDifficulty.Easy:
             SetDifficulty(10, 10, 10);
             break;
         case GameDifficulty.Medium:
             SetDifficulty(15, 15, 30);
             break;
         case GameDifficulty.Hard:
             SetDifficulty(20, 15, 55);
             break;
     }
 }
Example #54
0
        public GameWindow(Surface Screen, String MapName, GameDifficulty Difficulty)
            : base("GameWindow", 900, 700, Screen)
        {
            if (File.Exists("../../../../assets/Maps/" + MapName + ".xml"))
            {
                GameObj = new GameObject("../../../../assets/Maps/" + MapName + ".xml", Difficulty);
                GameObj.LoadMap("../../../../assets/Maps/" + MapName + ".xml");
            }
            else
            {
                GameObj = new GameObject("../../../../assets/Maps/thirdmap.xml", Difficulty);
                GameObj.LoadMap("../../../../assets/Maps/thirdmap.xml");
            }

            Init();
        }
Example #55
0
        public GameScreen(Game game, SpriteBatch spriteBatch, int screenHeight, int screenWidth, List<String> topics, 
            GameDifficulty difficulty)
        {
            this.Game = game;
            this.SpriteBatch = spriteBatch;
            ScreenHeight = screenHeight;
            ScreenWidth = screenWidth;
            Dividers = new List<BackgroundItem>();
            BingoBoards = new List<BackgroundItem>();
            PlayerTiles = new List<BingoTile>[PLAYER_COUNT];
            PlayerData = new Player[PLAYER_COUNT];
            this.Topics = topics;
            this.Difficulty = difficulty;

            for (int i = 0; i < PLAYER_COUNT; i++)
            {
                PlayerTiles[i] = new List<BingoTile>();
            }
        }
Example #56
0
        //OWN VARIABLE
        public GameState(Difficulty difficulty, ContentManager Content)
            : base(Content)
        {
            this.difficulty = difficulty;
            switch (difficulty)
            {
                case 0:
                    turn = 8;
                    break;
                case (Difficulty)1:
                    turn = 6;
                    break;
                case (Difficulty)2:
                    turn = 4;
                    break;
            }
            stateGame = Content.ServiceProvider.GetService(typeof(StateGame)) as StateGame;

            loadNeutralFactories();
        }
Example #57
0
        public LogicQuest(GameDifficulty difficulty, ContentManager Content)
            : base(difficulty,Content)
        {
            selectedVertices = 0;

            switch (difficulty)
            {

                case GameDifficulty.Easy:
                    timeToComplete = 15.0f;
                    break;

                case GameDifficulty.Normal:
                    timeToComplete = 10.0f;
                    break;

                case GameDifficulty.Hard:
                    timeToComplete = 8.0f;
                    break;
            }
        }
Example #58
0
        public Client(IPAddress server, String character, String account, String password, 
            GameDifficulty difficulty, String classicKey, String expansionKey, String exeInfo,
            UInt32 chickenLife, UInt32 potLife)
        {
            // Create objects
            m_status = Status.STATUS_UNINITIALIZED;
            m_difficulty = difficulty;
            m_d2gs = new D2GS(character, account, chickenLife, potLife);
            m_bnet = new Bnet(server, character, account, password,
                              difficulty, classicKey, expansionKey, exeInfo);

            m_gameCreationThread = new Thread(GameCreationThread);

            m_bnet.SubscribeStatusUpdates(UpdateStatus);
            m_bnet.SubscribeGameServerStart(StartGameServer);
            m_bnet.SubscribeClassByteUpdate(m_d2gs.UpdateClassByte);
            m_bnet.SubscribeGameCreationThread(MakeNextGame);
            m_bnet.SubscribeCharacterNameUpdate(m_d2gs.UpdateCharacterName);
            m_d2gs.SubscribeNextGameEvent(MakeNextGame);
            m_gameCreationThread.Name = account + "[CRTN]: ";
            m_gameCreationThread.Start();
        }
Example #59
0
        private string buildJson(string playerId, int score, GameMode mode, GameDifficulty difficulty, DateTime date, Dictionary<int, bool> answers)
        {
            //			{
            //			“player”:”Varyon”,
            //			“score”:10000,
            //			“difficulty”:0,
            //			“mode”:0,
            //			“date”:”2012-03-07 23:15:00”,
            //			“answers”: [
            //				           {“id” : 002, “result” : false},
            //				           {“id” : 003, “result” : true},
            //				            ]
            //			}

            JsonObject json = new JsonObject ();

            json.Add ("player", new JsonPrimitive (playerId));
            json.Add ("score", new JsonPrimitive (score));
            json.Add ("mode", new JsonPrimitive ((int)mode));
            json.Add ("difficulty", new JsonPrimitive ((int)difficulty));
            json.Add ("date", new JsonPrimitive (date.ToString ("yyyy-MM-dd hh:mm:ss")));

            List<JsonValue> answersItemsJson = new List<JsonValue> ();
            foreach (var gameId in answers.Keys) {

                JsonObject o = new JsonObject();
                o.Add("id", new JsonPrimitive(gameId));
                o.Add("result", new JsonPrimitive(answers[gameId]));

                answersItemsJson.Add (o);
            }

            JsonArray answersJson = new JsonArray (answersItemsJson);
            json.Add ("answers", answersJson);

            return json.ToString ();
        }
Example #60
0
        public void SendStats(string playerId, int score, GameMode mode, GameDifficulty difficulty, DateTime date, Dictionary<int, bool> answers, Action<int, Exception> callbackFailure)
        {
            var jsonBody = buildJson (playerId, score, mode, difficulty, date, answers);

            RequestPostJsonAsync (jsonBody, null, callbackFailure);
        }