Esempio n. 1
0
        public MinesweeperOpeningViewModel(CommandContainer container, IGamePackageResolver resolver, LevelClass global)
        {
            LevelPicker = new ListViewPicker(container, resolver); //hopefully this simple.
            LevelPicker.SelectionMode = ListViewPicker.EnumSelectionMode.SingleItem;
            LevelPicker.IndexMethod   = ListViewPicker.EnumIndexMethod.OneBased;
            _global = global;
            //no need for send processes.
            LevelChosen = _global.Level;
            this.PopulateMinesNeeded();
            LevelPicker.ItemSelectedAsync += LevelPicker_ItemSelectedAsync;
            LevelPicker.LoadTextList(new CustomBasicList <string>()
            {
                "Easy", "Medium", "Hard"
            });
            //LevelPicker.SelectSpecificItem(1);
            switch (LevelChosen)
            {
            case EnumLevel.Easy:
                LevelPicker.SelectSpecificItem(1);
                break;

            case EnumLevel.Medium:
                LevelPicker.SelectSpecificItem(2);
                break;

            case EnumLevel.Hard:
                LevelPicker.SelectSpecificItem(3);
                break;

            default:
                throw new BasicBlankException("Not Supported");
            }
            LevelPicker.IsEnabled = true; //take a risk this time.  not sure why it worked before.
        }
Esempio n. 2
0
 void Start()
 {
     level             = FindObjectOfType <LevelClass>();
     playerMovements   = FindObjectOfType <PlayerMovements>();
     playerAnimator    = GetComponentInChildren <Animator>();
     playerAudioSource = GetComponent <AudioSource>();
 }
    void Start()
    {
        levelClass = GetComponent <LevelClass>();
        //Level 1
        actualLevel = 1;
        if (actualLevel == 1)
        {
            levelClass.CountDown            = level1countDown;
            levelClass.LevelSpeed           = level1Speed;
            levelClass.randomLevelTilesList = new List <GameObject>();


            //Ajout des randomtiles du niveau 1 dans le randomleveltile

            foreach (GameObject Level1Tiles in Level1Tiles)
            {
                levelClass.randomLevelTilesList.Add(Level1Tiles);
            }
            levelClass.LevelSize = level1Size;
        }
        //Level 2
        //Level 3
        //Level 4
        //Level 5
        //Level boss

        //Generate Map
        tileSize = tileSprite.size.x;
        Map      = levelClass.MapGenerator();
        //SpawnTile


        actualTile = Instantiate(beginningTile);
    }
Esempio n. 4
0
 void Start()
 {
     GM = GameObject.Find("GameManager").GetComponent <GameManager>();
     LC = GameObject.Find("GameManager").GetComponent <LevelClass>();
     LM = GetComponent <LevelManager>();
     SetLevel();
     LM.GameStart();
 }
Esempio n. 5
0
 void Start()
 {
     level                   = FindObjectOfType <LevelClass>();
     playerMovements         = FindObjectOfType <PlayerMovements>();
     playerScript            = FindObjectOfType <PlayerScript>();
     HumanEnemiesAudioSource = GetComponent <AudioSource>();
     playerTriggers          = FindObjectOfType <PlayerScript>();
     humanEnemiesAnimator    = GetComponentInChildren <Animator>();
 }
Esempio n. 6
0
 public MastermindMainGameClass(IEventAggregator aggregator,
                                GlobalClass global,
                                LevelClass level
                                )
 {
     Aggregator = aggregator;
     _global    = global;
     _level     = level;
 }
Esempio n. 7
0
        private void generatePuzzleFromAppConfig()
        {
            int    rows  = int.Parse(ConfigurationManager.AppSettings["Rows"]);
            int    cols  = int.Parse(ConfigurationManager.AppSettings["Cols"]);
            string level = ConfigurationManager.AppSettings["Level"];

            PuzzleArgs args = new PuzzleArgs(rows, cols, LevelClass.getLevelFromString(level));

            puzzle.createGrid(args);
        }
Esempio n. 8
0
    public void SalvarLevel(string levelAtual, string faseMestra)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      fs = File.Create(Application.persistentDataPath + "/Level" + levelAtual + "_" + faseMestra + ".data");

        LevelClass levelObj = new LevelClass();

        levelObj.ativo = 1;
        bf.Serialize(fs, levelObj);
        fs.Close();
    }
Esempio n. 9
0
    public void SalvarLevelsMestra(int levels, int faseMestra)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      fs = File.Create(Application.persistentDataPath + "/FaseNumMestra" + faseMestra.ToString() + ".data");

        LevelClass levelObj = new LevelClass();

        levelObj.ativo = levels;
        bf.Serialize(fs, levelObj);
        fs.Close();
    }
Esempio n. 10
0
 public MinesweeperMainViewModel(IEventAggregator aggregator,
                                 CommandContainer commandContainer,
                                 IGamePackageResolver resolver,
                                 LevelClass level
                                 )
 {
     _aggregator = aggregator;
     LevelChosen = level.Level; //at this point, can't choose level because its already chosen.
     this.PopulateMinesNeeded();
     CommandContainer = commandContainer;
     _mainGame        = resolver.ReplaceObject <MinesweeperMainGameClass>(); //hopefully this works.  means you have to really rethink.
 }
        //will never show game over.

        public FroggiesMainViewModel(IEventAggregator aggregator,
                                     CommandContainer commandContainer,
                                     IGamePackageResolver resolver,
                                     LevelClass level
                                     )
        {
            _aggregator      = aggregator;
            StartingFrogs    = level.NumberOfFrogs;
            NumberOfFrogs    = level.NumberOfFrogs;
            CommandContainer = commandContainer;
            _mainGame        = resolver.ReplaceObject <FroggiesMainGameClass>(); //hopefully this works.  means you have to really rethink.
        }
Esempio n. 12
0
        // Use this for initialization
        void Start()
        {
            playerList   = gameObject.GetComponent <PlayerList>();
            currentLevel = gameObject.GetComponent <LevelClass>();

            if (playerList.Players.Count > 0)
            {
                currentPlayer          = playerList.Players [currentPlayerIndex];
                currentPlayer.Selected = true;
            }
            else
            {
                throw new MissingReferenceException("No players available");
            }
        }
Esempio n. 13
0
    public int LoadLevel(string levelAtual, string faseMestra)
    {
        int temp = 0;

        if (File.Exists(Application.persistentDataPath + "/Level" + levelAtual + "_" + faseMestra + ".data"))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream      fs = File.Open(Application.persistentDataPath + "/Level" + levelAtual + "_" + faseMestra + ".data", FileMode.Open);

            LevelClass levelObj = (LevelClass)bf.Deserialize(fs);
            fs.Close();
            temp = levelObj.ativo;
        }
        return(temp);
    }
Esempio n. 14
0
    public int LoadLevelsMestra(int faseMestra)
    {
        int temp = 0;

        if (File.Exists(Application.persistentDataPath + "/FaseNumMestra" + faseMestra.ToString() + ".data"))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream      fs = File.Open(Application.persistentDataPath + "/FaseNumMestra" + faseMestra.ToString() + ".data", FileMode.Open);

            LevelClass levelObj = (LevelClass)bf.Deserialize(fs);
            fs.Close();
            temp = levelObj.ativo;
        }
        return(temp);
    }
Esempio n. 15
0
 void Start()
 {
     //Clear items in dropdown
     levelSelector.ClearOptions();
     //Create Level List
     levels = new List <LevelClass>();
     //Set Levelanzahl
     Data.data.level = 4;
     //Create new items and add
     for (int i = 1; i <= 4; ++i)
     {
         LevelClass tmp = new LevelClass(i);
         levels.Add(tmp);
         levelSelector.options.Add((Dropdown.OptionData)tmp);
     }
 }
 public MastermindOpeningViewModel(CommandContainer container, IGamePackageResolver resolver, LevelClass global)
 {
     LevelPicker = new ListViewPicker(container, resolver); //hopefully this simple.
     LevelPicker.SelectionMode = ListViewPicker.EnumSelectionMode.SingleItem;
     LevelPicker.IndexMethod   = ListViewPicker.EnumIndexMethod.OneBased;
     _global          = global;
     CommandContainer = container;
     LevelChosen      = _global.LevelChosen;
     LevelPicker.LoadTextList(new CustomBasicList <string>()
     {
         "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6"
     });
     LevelPicker.ItemSelectedAsync += LevelPicker_ItemSelectedAsync;
     LevelPicker.SelectSpecificItem(LevelChosen);
     LevelPicker.IsEnabled = true;
 }
Esempio n. 17
0
    private void Awake()
    {
        //Debug.Log("Awake");
        instance = this;

        if (namescene <= PlayerPrefs.GetInt("LevelPassed"))
        {
            LevelState = State.Finished;
        }
        else if (namescene == PlayerPrefs.GetInt("LevelPassed") + 1)
        {
            LevelState = State.Unlocked;
        }
        else
        {
            LevelState = State.Locked;
        }
    }
Esempio n. 18
0
    public void IntialzeTheNewData()
    {
        for (int i = 0; i < 5; i++)
        {
            _playerData.TotalCorrectAnswers = 0;
            LevelClass obj = new LevelClass();
            obj.levelNum = i;

            obj.Active = "false";
            _playerData.LevelsData.Add(obj);

            for (int j = 0; j < 7; j++)
            {
                ClassCategory newobj = new ClassCategory();
                newobj.categotyName   = (j + 1).ToString();
                newobj.CorrectAnswers = 0;
                _playerData.LevelsData [i].categories.Add(newobj);
            }
        }
    }
        public MastermindMainView(IEventAggregator aggregator, LevelClass level)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackPanel stack = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(MastermindMainViewModel.ActiveViewModel)
            };

            stack.Children.Add(parent);
            Grid grid = new Grid();

            grid.Background = Brushes.Brown;
            grid.Width      = 200;
            EnumPickerWPF <CirclePieceCP <EnumColorPossibilities>, CirclePieceWPF <EnumColorPossibilities>, EnumColorPossibilities> colors = new EnumPickerWPF <CirclePieceCP <EnumColorPossibilities>, CirclePieceWPF <EnumColorPossibilities>, EnumColorPossibilities>();

            colors.Rows = 10; //try this way now.
            colors.HorizontalAlignment = HorizontalAlignment.Center;
            _colors = colors;
            var acceptBut = GetGamingButton("Accept", nameof(MastermindMainViewModel.AcceptAsync));
            var giveUpBut = GetGamingButton("Give Up", nameof(MastermindMainViewModel.GiveUpAsync));
            var label     = GetDefaultLabel();

            label.FontSize = 20;
            label.Text     = $"Level Chosen:  {level.LevelChosen}";
            grid.Children.Add(colors);
            grid.Margin = new Thickness(10);
            stack.Children.Add(grid);
            StackPanel other = new StackPanel();

            other.Children.Add(acceptBut);
            other.Children.Add(giveUpBut);
            other.Children.Add(label);
            stack.Children.Add(other);
            Content = stack;
        }
Esempio n. 20
0
 public FroggiesOpeningViewModel(CommandContainer container,
                                 IGamePackageResolver resolver,
                                 LevelClass global,
                                 BasicData data
                                 )
 {
     _global          = global;
     CommandContainer = container;
     NumberOfFrogs    = _global.NumberOfFrogs;
     LevelPicker      = new NumberPicker(container, resolver);
     if (data.IsXamarinForms == false)
     {
         LevelPicker.LoadNormalNumberRangeValues(3, 70);
     }
     else
     {
         LevelPicker.LoadNormalNumberRangeValues(3, 40); //maybe can load more.  well see.
     }
     LevelPicker.SelectNumberValue(NumberOfFrogs);
     LevelPicker.ChangedNumberValueAsync += LevelPicker_ChangedNumberValueAsync;
 }
Esempio n. 21
0
    private void PopulateScrollBox()
    {
        List <LevelClass> LevelList = GetAllLevels();

        content.sizeDelta = new Vector2(0, LevelList.Count * 60);
        for (int i = 0; i < LevelList.Count; i++)
        {
            // 60 width of item
            float spawnY = i * 60;
            //newSpawn Position
            Vector3 pos = new Vector3(SpawnPoint.position.x, -spawnY, SpawnPoint.position.z);
            //instantiate item
            GameObject SpawnedItem = Instantiate(MapButton, pos, SpawnPoint.rotation);
            //setParent
            SpawnedItem.transform.SetParent(SpawnPoint, false);
            //get ItemDetails Component
            LevelClass Details = null;
            try
            {
                Details = SpawnedItem.GetComponent <GameObject>().GetComponent <MapLoader>().Level;
                if (Details != null)
                {
                    Debug.Log("WORKS!!!!");
                }
            }
            catch (Exception e) {
            }
            if (SpawnedItem.GetComponentInChildren <MapLoader>() != null)
            {
                Debug.Log("MapLoadScript");
            }
            //SpawnedItem.GetComponentInChildren<MapLoader>().Level.Name = "ITFUCKINGWORKS";
            //LevelList[i].Description.text = "ITFUCKINGWORKS";
            SpawnedItem.GetComponentInChildren <MapLoader>().Level = LevelList[i];
            if (SpawnedItem.GetComponentInChildren <MapLoader>().Level.Name != null)
            {
                Debug.Log("NameWorks");
            }
        }
    }
        public MastermindMainViewModel(IEventAggregator aggregator, CommandContainer commandContainer,
                                       IGamePackageResolver resolver,
                                       LevelClass level
                                       )
        {
            _aggregator = aggregator;
            //looks like can't just ask for the mainboard.  because if you do, then when i change the global class, they have the old one (wrong)
            LevelChosen      = level.LevelChosen;
            CommandContainer = commandContainer;
            _global          = resolver.ReplaceObject <GlobalClass>(); //looks like global has to be replaced before game.  otherwise, reference is broken.
            CustomColorClass colorClass = new CustomColorClass(_global);

            //hopefully won't cause another problem (?)
            _mainGame = resolver.ReplaceObject <MastermindMainGameClass>(); //hopefully this works.  means you have to really rethink.



            MainBoard = resolver.Resolve <GameBoardViewModel>(); //by this time, it will have the proper global class.
            //ActiveViewModel = MainBoard;
            Color1 = new SimpleEnumPickerVM <EnumColorPossibilities, CirclePieceCP <EnumColorPossibilities> >(commandContainer, colorClass);
            Color1.AutoSelectCategory = EnumAutoSelectCategory.AutoEvent;
            Color1.IsEnabled          = true;
            Color1.ItemClickedAsync  += Color1_ItemClickedAsync;
        }
 void Start()
 {
     levelClass = FindObjectOfType <LevelClass>();
 }
Esempio n. 24
0
 private void OnEnable()
 {
     _myTarget = (LevelClass)this.target;
 }
Esempio n. 25
0
 // Use this for initialization
 public void Init(int sizeField, int scoreForWin, int turns, int ballTypes)
 {
     level = new LevelClass(scoreForWin, turns, sizeField, ballTypes);
     balls = new GameObject[sizeField, sizeField];
     ShowLevel();
 }
 void Start()
 {
     actualTile          = GetComponent <Rigidbody2D>();
     actualLevel         = FindObjectOfType <LevelClass>();
     actualTile.velocity = new Vector2(actualLevel.LevelSpeed, 0);
 }
Esempio n. 27
0
 // Use this for initialization
 void Start()
 {
     levelClass    = FindObjectOfType <LevelClass>();
     spawnPosition = new Vector2(-11f, 4.3f);
     player        = GameObject.FindGameObjectWithTag("Player");
 }
Esempio n. 28
0
 public GlobalClass(LevelClass level)
 {
     _level = level;
 }
Esempio n. 29
0
 void Start()
 {
     levelClass = GetComponent <LevelClass>();
 }