Inheritance: MonoBehaviour
        private long GetVerbStart(int NoteIndex)
        {
            NoteObject no      = partsObject.NoteList[NoteIndex];
            long       verbLen = (long)((double)partsObject.NoteList[NoteIndex].Length * no.VerbPrecent);

            return(no.Tick + no.Length - verbLen);
        }
Beispiel #2
0
    //Remove a holding note
    protected virtual void RemoveNote()
    {
        NoteObject note = GvrPointerInputModule.Pointer.PointerTransform.GetComponentInChildren <NoteObject>();

        note.transform.SetParent(null);
        Destroy(note.GetComponent <PhotonView>());
    }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            NoteObject noteObj = new NoteObject();

            UpdateData(noteObj);

            if (Validation(noteObj) == "true")
            {
                if (noteController.UpdateNote(MainForm.ID_NOTE, noteObj) == false)
                {
                    warning.Message = "Có lỗi, vui lòng thử lại.";
                    warning.ShowDialog();
                }
                else
                {
                    success.Message = "Ghi chú đã được Cập nhật thành công.";
                    success.ShowDialog();
                }
            }
            else
            {
                success.Message = Validation(noteObj);
                success.ShowDialog();
            }
        }
 public ParamValuePair(NoteObject Note, long Value)
 {
     this.PNote    = Note;
     this.Tick     = PNote.Tick;
     this.Value    = Value;
     _isBindedNote = true;
 }
Beispiel #5
0
    IEnumerator Miss(NoteObject note)
    {
        note.GetComponent <Collider2D>().enabled = false;
        yield return(new WaitForSeconds(2));

        note.gameObject.SetActive(false);
    }
        private string Validation(NoteObject noteObj)
        {
            string result = string.Empty;

            if (noteObj._TITLE == "" || noteObj._TITLE.Length == 0)
            {
                result = "Tiêu đề không được để trống.";
            }
            else if (noteObj._BODY == "" || noteObj._BODY.Length == 0)
            {
                result = "Nội dung không được để trống.";
            }
            else if (ckNoteDatetime.Checked == false)
            {
                noteObj._ALARM = null;
                result         = "true";
            }
            else if (ckNotePass.Checked == false)
            {
                noteObj._PASSWORD = string.Empty;
                result            = "true";
            }
            else
            {
                result = "true";
            }
            return(result);
        }
Beispiel #7
0
    //public JsonDecoder.NoteData[] noteDatas;

    public void GenerateNoteObjects()
    {
        NotesForDifficulty midiNotes = GameManager.Instance.songLoader.songLibrary.songs[GameManager.Instance.SelectedSong].difficulties[GameManager.Instance.SongDifficulty];

        noteObjects = new NoteObject[midiNotes.notes.Count];

        ActiveNoteObjects = new List <NoteObject>();

        for (int i = 0; i < midiNotes.notes.Count; i++)
        {
            noteObjects[i] = new NoteObject();

            noteObjects[i].time = midiNotes.notes[i].time;

            noteObjects[i].pad = midiNotes.notes[i].pad;

            noteObjects[i].StartTime = noteObjects[i].time + HitTargetTimeOffsetMS - NoteAppearTimeMS;

            noteObjects[i].TargetTime = noteObjects[i].time + HitTargetTimeOffsetMS;

            noteObjects[i].ExpireTime = noteObjects[i].time + HitTargetTimeOffsetMS + HitThresholdMS;

            noteObjects[i].CanHitTime = noteObjects[i].time + HitTargetTimeOffsetMS - HitThresholdMS;

            //noteObjects[i].NoteVisual = GameObject.Instantiate(NotePrefab, new Vector3(noteObjects[i].pad*2, 0, 0), Quaternion.identity);
        }
    }
    /// <summary>
    /// Handleinput for the objects in the level
    /// </summary>
    /// <param name="inputHelper">The inputhelper to react to input</param>
    public override void HandleInput(InputHelper inputHelper)
    {
        if (inputHelper.KeyPressed(Keys.F) && NoteInVicinity)
        {
            foreach (GameObject obj in gameObjects)
            {
                if (obj is NoteObject)
                {
                    foreach (Sound sound in MusicPlayer.SoundEffect)
                    {
                        if (sound.Name == "paperrustle")
                        {
                            sound.PlaySound();
                        }
                    }
                    NoteObject note = obj as NoteObject;
                    note.PickUp();
                }
            }
        }

        if (inputHelper.KeyPressed(Keys.R))
        {
            this.completed = true;
        }

        Find("Player").HandleInput(inputHelper);
    }
        /// <summary>
        /// Checks whenever the specified <see cref="PlayerstatisticExtended"/> matches the specified <see cref="NoteObject"/>
        /// </summary>
        /// <param name="note"><see cref="NoteObject"/> to match</param>
        /// <param name="playerstatistic"><see cref="PlayerstatisticExtended"/> to match</param>
        /// <returns>True if matches, otherwise - false</returns>
        public static bool IsMatch(NoteObject note, PlayerstatisticExtended playerstatistic)
        {
            var selectedPlayerStatistics = new List <PlayerstatisticExtended> {
                playerstatistic
            };

            selectedPlayerStatistics = FilterByMiscConditions(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByPositionCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByPreflopFacingCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByPositionThreeBetCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByPositionRaiserCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByNoOfPlayerCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByStakeCondition(selectedPlayerStatistics, note.Settings);

            selectedPlayerStatistics = FilterByHoleCardCondition(selectedPlayerStatistics, note.Settings);

            selectedPlayerStatistics = FilterByPreflopActionCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByFlopActionCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByTurnActionCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByRiverActionCondition(selectedPlayerStatistics, note.Settings);

            selectedPlayerStatistics = FilterByFlopTextureCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByTurnTextureCondition(selectedPlayerStatistics, note.Settings);
            selectedPlayerStatistics = FilterByRiverTextureCondition(selectedPlayerStatistics, note.Settings);

            selectedPlayerStatistics = FilterByHandValueConditions(selectedPlayerStatistics, note.Settings.FlopHvSettings, Street.Flop);
            selectedPlayerStatistics = FilterByHandValueConditions(selectedPlayerStatistics, note.Settings.TurnHvSettings, Street.Turn);
            selectedPlayerStatistics = FilterByHandValueConditions(selectedPlayerStatistics, note.Settings.RiverHvSettings, Street.River);

            selectedPlayerStatistics = FilterByAllSelectedFilters(selectedPlayerStatistics, note.Settings.SelectedFilters, note.Settings.SelectedFiltersComparison);

            return(selectedPlayerStatistics.Count > 0);
        }
        public void UpdateLyrics(ref PartsObject parts, int NoteIndex)
        {
            int curIndex = NoteIndex;

            NoteObject[] NoteMap = new NoteObject[] { null, null, null, null, null };

            NoteMap[0] = curIndex - 2 >= 0 ? parts.NoteList[curIndex - 2] : null;
            NoteMap[1] = curIndex - 1 >= 0 ? parts.NoteList[curIndex - 1] : null;
            NoteMap[2] = parts.NoteList[curIndex];
            NoteMap[3] = curIndex + 1 < parts.NoteList.Count ? parts.NoteList[curIndex + 1] : null;
            NoteMap[4] = curIndex + 2 < parts.NoteList.Count ? parts.NoteList[curIndex + 2] : null;
            // p2 p1 cur
            // p1 cur n1
            // cur n1 n2
            if (NoteMap[1] != null)
            {
                SetupCurrentPhonmem(NoteMap[0], NoteMap[1], NoteMap[2], parts.Tempo, parts.UseLyricDicitonary);
            }
            if (NoteMap[2] != null)
            {
                SetupCurrentPhonmem(NoteMap[1], NoteMap[2], NoteMap[3], parts.Tempo, parts.UseLyricDicitonary);
            }
            if (NoteMap[3] != null)
            {
                SetupCurrentPhonmem(NoteMap[2], NoteMap[3], NoteMap[4], parts.Tempo, parts.UseLyricDicitonary);
            }
        }
        private void UpdateData(NoteObject noteObj)
        {
            noteObj._ID_USER         = MainForm.ID_USER;
            noteObj._TITLE           = txtTitleNote.Text.Trim();
            noteObj._BODY            = txtBodyNote.Text.Trim();
            noteObj._ID_CATEGORY     = int.Parse(cbCategory.SelectedValue.ToString());
            noteObj._DATETIME_UPDATE = now;

            if (ckNotePass.Checked == true)
            {
                noteObj._PASSWORD = txtPassNote.Text.Trim();
            }
            else
            {
                noteObj._PASSWORD = string.Empty;
            }

            if (ckNoteDatetime.Checked == true)
            {
                noteObj._ALARM = dtDatePicker.Value;
            }
            else
            {
                noteObj._ALARM = null;
            }
        }
 public void AddRPCNote(NoteObject noteObject)
 {
     //noteObject.transform.position = PositionNote(NotesHold.Count);
     //noteObject.transform.rotation = transform.rotation;
     NotesHold.Add(noteObject);
     noteObject.transform.SetParent(rail.transform);
 }
    //检测是否生成下一个新音符
    void CheckSpawnNext()
    {
        int samplesToTarget = GetSpawnSampleOffset();

        int currentTime = gameController.DelayedSampleTime;

        while (pendingEventIdx < laneEvents.Count &&
               laneEvents[pendingEventIdx].StartSample < currentTime + samplesToTarget)
        {
            KoreographyEvent evt       = laneEvents[pendingEventIdx];
            int        noteNum         = evt.GetIntValue();
            NoteObject newObj          = gameController.GetFreshNoteObject();
            bool       isLongNoteStart = false;
            bool       isLongNoteEnd   = false;
            if (noteNum > 6)
            {
                isLongNoteStart = true;
                noteNum         = noteNum - 6;
                if (noteNum > 6)
                {
                    isLongNoteEnd   = true;
                    isLongNoteStart = false;
                    noteNum         = noteNum - 6;
                }
            }
            newObj.Initialize(evt, noteNum, this, gameController, isLongNoteStart, isLongNoteEnd);
            trackedNotes.Enqueue(newObj);
            pendingEventIdx++;
        }
    }
        public void UpdateOutboundsLyric(ref PartsObject parts, int StartNoteIndex, int EndNoteIndex)
        {
            if (EndNoteIndex < 0)
            {
                EndNoteIndex = parts.NoteList.Count - 1;
            }
            if (StartNoteIndex < 0)
            {
                StartNoteIndex = 0;
            }
            if (EndNoteIndex > parts.NoteList.Count - 1)
            {
                EndNoteIndex = parts.NoteList.Count - 1;
            }

            NoteObject[] NoteMap = new NoteObject[] { null, null, null, null, null, null };

            NoteMap[0] = StartNoteIndex - 2 >= 0 ? parts.NoteList[StartNoteIndex - 2] : null;
            NoteMap[1] = StartNoteIndex - 1 >= 0 ? parts.NoteList[StartNoteIndex - 1] : null;
            NoteMap[2] = parts.NoteList[StartNoteIndex];


            NoteMap[3] = parts.NoteList[EndNoteIndex];
            NoteMap[4] = EndNoteIndex + 1 < parts.NoteList.Count ? parts.NoteList[EndNoteIndex + 1] : null;
            NoteMap[5] = EndNoteIndex + 2 < parts.NoteList.Count ? parts.NoteList[EndNoteIndex + 2] : null;

            if (NoteMap[1] != null)
            {
                SetupCurrentPhonmem(NoteMap[0], NoteMap[1], NoteMap[2], parts.Tempo, parts.UseLyricDicitonary);
            }
            if (NoteMap[4] != null)
            {
                SetupCurrentPhonmem(NoteMap[3], NoteMap[4], NoteMap[5], parts.Tempo, parts.UseLyricDicitonary);
            }
        }
Beispiel #15
0
 // Use this for initialization
 void Start()
 {
     note    = GetComponent <NoteObject> ();
     manager = GameObject.Find("NotesManagement").GetComponent <NotesManagement> ();
     player  = GameObject.Find("PlayerManagement").GetComponent <PlayerManagement>();
     hp      = GameObject.Find("HP_BarCtrl").GetComponent <HP_BarCtrl>();
 }
    protected void CreateNote(NoteObject note, TileGrid tileGrid)
    {
        for (int x = 0; x < tileGrid.Columns; x++)
        {
            for (int y = 0; y < tileGrid.Rows; y++)
            {
                if (tileGrid.Get(x, y) != null && tileGrid.Get(x, y) is WallTile)
                {
                    if (tileGrid.Get(x + 1, y) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position + new Vector3(102 /*100+modelDepth*/, 0, 0);
                    }
                    else if (tileGrid.Get(x, y + 1) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position + new Vector3(0, 0, 102);
                    }

                    else if (tileGrid.Get(x - 1, y) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position - new Vector3(102, 0, 0);
                    }
                    else if (tileGrid.Get(x, y - 1) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position - new Vector3(0, 0, 102);
                    }
                }
            }
        }
    }
Beispiel #17
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetKeyDown(keyToPress))
            {
                spriteRenderer.sprite = pressedSprite;

                if (GameManager.Instance.GetNotesCount(side) == 0)
                {
                    return;
                }
                else if (GameManager.Instance.noteInRange)
                {
                    NoteObject note = GameManager.Instance.PeekNote(side);
                    if (note.keyToPress == keyToPress)
                    {
                        GameManager.Instance.JudgeNote(note);
                        Destroy(note.gameObject);
                    }
                }
            }
            else if (Input.GetKeyUp(keyToPress))
            {
                spriteRenderer.sprite = defaultSprite;
            }
        }
        List <PitchObject>[] getPitchObjLists(long MinTick = -1, long MaxTick = -1)
        {
            long nt = MinTick > 0 ? MinTick : PianoWindow.MinShownTick;
            long mt = MaxTick > nt ? MaxTick : PianoWindow.MaxShownTick;


            List <KeyValuePair <long, long> > Partsy = new List <KeyValuePair <long, long> >();
            long st = -1;
            long et = -1;

            for (int i = 0; i < NoteList.Count; i++)
            {
                NoteObject PN = NoteList[i];
                if (PN.Tick >= mt)
                {
                    break;
                }
                if (PN.Tick + PN.Length < nt)
                {
                    continue;
                }
                if (et != -1 && PN.Tick - et > AntiBordTick)//AntiBordTick在这里为音符间最大间隔
                {
                    if (st != -1)
                    {
                        Partsy.Add(new KeyValuePair <long, long>(st, et));
                        st = -1;
                        et = -1;
                    }
                }
                if (st == -1)
                {
                    st = PN.Tick;
                }
                et = PN.Tick + PN.Length;
            }
            if (st != -1 && et != -1)
            {
                Partsy.Add(new KeyValuePair <long, long>(st, et));
                st = -1;
                et = -1;
            }
            List <List <PitchObject> > Ret = new List <List <PitchObject> >();

            foreach (KeyValuePair <long, long> SE in Partsy)
            {
                if (SE.Key < SE.Value)
                {
                    List <PitchObject> PList = new List <PitchObject>();
                    for (long i = TickSortList <PitchObject> .TickFormat(SE.Key); i <= TickSortList <PitchObject> .TickFormat(SE.Value); i = i + TickSortList <PitchObject> .TickStep)
                    {
                        PartsObject po = PartsObject;
                        PList.Add(new PitchObject(i, po.PitchCompiler.getRealPitch(i)));
                    }
                    Ret.Add(PList);
                }
            }
            return(Ret.ToArray());
        }
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.CompareTag("Collider"))
     {
         canBePressed = false;
         latestNote   = null;
     }
 }
Beispiel #20
0
    //Click on a note which is in a receptacle and holding in the same time a note. Swap notes.
    public void SwapNotes(NoteObject note)
    {
        NoteReceptacle tmp = Receptacle;

        Receptacle.SwapNote(note);
        TryGrab(null);
        tmp.gameObject.layer = LayerMask.NameToLayer("GvrCannotGrab");
    }
Beispiel #21
0
    void Awake()
    {
        noteObject = GetComponent <NoteObject>();

        noteObject.Hit.AddListener((x) => Hit(x));

        sprite = GetComponentInChildren <SpriteRenderer>();
    }
 // Start is called before the first frame update
 void Start()
 {
     thisNote = GetComponent <NoteObject>();
     if (thisNote)
     {
         thisRail = GetComponentInParent <Rail>();
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Collider"))
     {
         canBePressed = true;
         latestNote   = other.GetComponentInParent <NoteObject>();
     }
 }
Beispiel #24
0
    public void SetKeysoundText()
    {
        NoteObject noteObject = GetComponent <NoteObject>();

        GetComponentInChildren <TextMeshProUGUI>(includeInactive: true)
        .text = UIUtils.StripAudioExtension(
            noteObject.note.sound);
    }
Beispiel #25
0
 public void SetNote(int height, NoteObject no)
 {
     notes[height]           = no;
     sequencer.Notes[height] = no != null ? no.note : null;
     foreach (var s in StepsVisu)
     {
         s.UpdateNote();
     }
 }
 /* Stop tracking the argument note because it was missed
  * Also generates the "miss" effect at the bottom of the screen and penalizes score.
  */
 public void UntrackNote(NoteObject n)
 {
     if (clickableNotes[n.GetLane()] == n)
     {
         clickableNotes[n.GetLane()] = null;
     }
     GenerateHitEffect(0, buttTransforms[n.GetLane()].position.x, 10); // miss effect from bottom of screen
     UpdateScore(-1);
 }
 //将音符对象放回对象池
 public void ReturnNoteObjectToPool(NoteObject obj)
 {
     if (obj != null)
     {
         obj.enabled = false;
         obj.gameObject.SetActive(false);
         noteObjectPool.Push(obj);
     }
 }
    //检测是否有击中音符对象
    //如果是,它将执行命中并删除
    public void CheckNoteHit()
    {
        if (!gameController.gameStart)
        {
            CreateDownEffect();
            return;
        }
        if (trackedNotes.Count > 0)
        {
            NoteObject noteObject = trackedNotes.Peek();
            if (noteObject.hitOffset > -6000)
            {
                trackedNotes.Dequeue();
                int hitLevel = noteObject.IsNoteHittable();
                gameController.ChangeHitLevelSprite(hitLevel);
                if (hitLevel > 0)
                {
                    //更新分数
                    gameController.UpdateScoreText(100 * hitLevel);
                    if (noteObject.isLongNote)
                    {
                        hasLongNote = true;
                        CreateHitLongEffect();
                    }
                    else if (noteObject.isLongNoteEnd)
                    {
                        hasLongNote = false;
                    }
                    else
                    {
                        CreateHitEffect();
                    }

                    //增加连接数
                    gameController.comboNum++;
                }
                else
                {
                    //未击中
                    //减少玩家HP
                    gameController.UpdateHP();
                    //断掉玩家命中连接数
                    gameController.HideComboNumText();
                    gameController.comboNum = 0;
                }
                noteObject.OnHit();
            }
            else
            {
                CreateDownEffect();
            }
        }
        else
        {
            CreateDownEffect();
        }
    }
Beispiel #29
0
 public static void Create(Map.Note mapNote)
 {
     UnityMainThreadDispatcher.Instance().Enqueue(() => {
         GameObject gameObject  = Instantiate(Prefab);
         NoteObject noteObjComp = gameObject.GetComponent <NoteObject>();
         noteObjComp.MapNote    = mapNote;
         noteObjComp.Load();
     });
 }
        /// <summary>
        /// このノーツを破棄する
        /// 必ずMusicSheet.DestroyObjectから呼び出される
        /// </summary>
        public void DestroyObject()
        {
            NoteObject.Stop();
            NoteObject = null;

            foreach (MusicTapLineObject line in LineObjects)
            {
                line.Delete();
            }
        }
 private async Task<bool> UpdateNote(NoteObject obj)
 {
     if (obj == null || String.IsNullOrWhiteSpace(obj.ObjectId)) return false;
     CoreDispatcher core = CoreApplication.MainView.CoreWindow.Dispatcher;
     await core.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         Notes.Add(obj);
         OnPropertyChanged("Notes");
     });
     return true;
 }
 public async void DeleteObject(NoteObject note)
 {
     if (note == null) return;
     try
     {
         var item = _store.Retrieve(NotesSoup,
             _store.LookupSoupEntryId(NotesSoup, Constants.Id, note.ObjectId))[0].ToObject<JObject>();
         item[SyncManager.Local] = true;
         item[SyncManager.LocallyDeleted] = true;
         _store.Upsert(NotesSoup, item);
         note.Deleted = true;
         await UpdateNote(note);
     }
     catch (Exception)
     {
         Debug.WriteLine("Exception occurred while trying to delete");
     }
 }
        public async void SaveNote(NoteObject note, bool isCreated)
        {
            if (note == null) return;
            try
            {
                QuerySpec querySpec = QuerySpec.BuildExactQuerySpec(NotesSoup, Constants.Id, note.ObjectId, 1);
                JArray returned = _store.Query(querySpec, 0);
                JObject item = returned.Count > 0 ? returned[0].ToObject<JObject>() : new JObject();

                item[NoteObject.TitleField] = note.Title;
                item[NoteObject.ContentField] = Convert.ToBase64String(Encoding.UTF8.GetBytes(note.Content));
                item[SyncManager.Local] = true;
                item[SyncManager.LocallyUpdated] = !isCreated;
                item[SyncManager.LocallyCreated] = isCreated;
                item[SyncManager.LocallyDeleted] = false;
                if (isCreated && item[Constants.Attributes.ToLower()] == null)
                {
                    item[Constants.Id] = "local_" + SmartStore.CurrentTimeMillis;
                    note.ObjectId = item[Constants.Id].Value<string>();
                    var attributes = new JObject();
                    attributes[Constants.Type.ToLower()] = Constants.Contact;
                    item[Constants.Attributes.ToLower()] = attributes;
                    _store.Create(NotesSoup, item);
                }
                else
                {
                    _store.Upsert(NotesSoup, item);
                }
                note.UpdatedOrCreated = true;
                await UpdateNote(note);
            }
            catch (Exception)
            {
                Debug.WriteLine("Exception occurred while trying to save");
            }
        }
    /// <summary>
    /// Creating/generating the level itself
    /// </summary>
    /// <param name="roomNumber">The number of the room</param>
    /// <param name="tiles">The size the Mainpath should be, counted in tiles</param>
    /// <param name="chased">Whether or not the monster is chasing the player</param>
    public RandomLevel(int roomNumber, int tiles = 12, bool chased = false, int noteID = 0)
    {
        //Setting a boolean for the monster
        this.chased = chased;

        //Assining the variables
        tileList = new Dictionary<Point, Tile>();
        keyList = new List<Point>();

        random = GameEnvironment.Random;

        //Select the tiles to use
        int pathType = random.Next(4);
        if (pathType < 9)
            pathID = "0" + (pathType + 1);
        else
            pathID = "" + (pathType + 1);

        int wallType = random.Next(4);
        if (wallType < 9)
            wallID = "0" + (wallType + 1);
        else
            pathID = "" + (wallType + 1);
        newTile = new EntryTile(pathID);
        this.tiles = tiles;

        //Create the startpoint
        position = Point.Zero;
        tileList.Add(position, newTile);
        keyList.Add(position);

        //Creating the paths
        CreateMainPath();
        for (int i = random.Next(1, (int)Math.Pow(tiles,2/3)); i > 0; i--)
            CreateSidePath(random.Next(3, 15), chased);

        //making the tile grid
        TileGrid tileGrid = Grid;
        gameObjects.Add(tileGrid);

        //making the player
        player = new Player(Vector3.Zero);
        gameObjects.Add(player);
        player.Parent = this;
        player.LoadContent();

        foreach(GameObject obj in tileGrid.Objects)
        {
            if (obj != null)
                if(obj.ID == "EntryTile")
                {
                    player.Position = new Vector3(obj.Position.X, obj.Position.Y + GameObjectGrid.CellHeight, obj.Position.Z);
                    foreach(GameObject tile in tileGrid.Objects)
                    {
                        if (tile != null)
                        {
                            if (tile.Position.X == obj.Position.X + 200 && tile.Position.Z == obj.Position.Z && tile.ID == "PathTile")
                                player.viewAngleX = 0f;
                            if (tile.Position.X == obj.Position.X && tile.Position.Z == obj.Position.Z + 200 && tile.ID == "PathTile")
                                player.viewAngleX = (float)(Math.PI / 2);
                            if (tile.Position.X == obj.Position.X - 200 && tile.Position.Z == obj.Position.Z && tile.ID == "PathTile")
                                player.viewAngleX = (float)(Math.PI);
                            if (tile.Position.X == obj.Position.X && tile.Position.Z == obj.Position.Z - 200 && tile.ID == "PathTile")
                                player.viewAngleX = (float)(Math.PI * 1.5);
                        }
                    }
                }
        }

        //Adding decoration objects
        TileGrid grid = Find("TileGrid") as TileGrid;
        for (int x = 0; x < grid.Columns; x++)
            for (int y = 0; y < grid.Rows; y++)
                if (grid.Get(x, y) != null)
                {
                    if (grid.Get(x, y).ID == "WallTile" && GameEnvironment.Random.Next(15) == 0)
                    {
                        try
                        {
                            if (grid.Get(x + 1, y) != null && grid.Get(x + 1, y).ID == "PathTile" && grid.Get(x + 1, y).ID != "DecorationTile")
                            {
                                AddDecoration(grid.Get(x, y).Position, new Vector3(-1, 0, 0));
                                grid.Add(new DecorationTile(pathID), x + 1, y);
                            }
                            else if (grid.Get(x, y + 1) != null && grid.Get(x, y + 1).ID == "PathTile" && grid.Get(x, y + 1).ID != "DecorationTile")
                            {
                                AddDecoration(grid.Get(x, y).Position, new Vector3(0, 0, -1));
                                grid.Add(new DecorationTile(pathID), x, y + 1);
                            }
                            else if (grid.Get(x - 1, y) != null && grid.Get(x - 1, y).ID == "PathTile" && grid.Get(x - 1, y).ID != "DecorationTile")
                            {
                                AddDecoration(grid.Get(x, y).Position, new Vector3(1, 0, 0));
                                grid.Add(new DecorationTile(pathID), x - 1, y);
                            }
                            else if (grid.Get(x, y - 1) != null && grid.Get(x, y - 1).ID == "PathTile" && grid.Get(x, y - 1).ID != "DecorationTile")
                            {
                                AddDecoration(grid.Get(x, y).Position, new Vector3(0, 0, 1));
                                grid.Add(new DecorationTile(pathID), x, y - 1);
                            }
                        }
                        catch (IndexOutOfRangeException e) { Console.WriteLine(e.StackTrace); }
                    }
                }

        //Add the note
        if (noteID != 0)
        {
            NoteObject note = new NoteObject(noteID.ToString());
            note.Parent = this;
            CreateNote(note, tileGrid);
            gameObjects.Add(note);
        }

        //Making the monster
        if (chased)
        {
            monster = new Monster(Grid.Objects);
            monster.Parent = this;
            monster.LoadContent();
            gameObjects.Add(monster);
        }

        //Making the stamina bar
        stamina = new Stamina();
        gameObjects.Add(stamina);
        stamina.Parent = this;
        exitText.text = "Press E to proceed";

        //Making the room counter
        roomCounter = new TextGameObject("text");
        roomCounter.text = roomNumber.ToString();
        gameObjects.Add(roomCounter);
    }
    protected void CreateNote(NoteObject note, TileGrid tileGrid)
    {
        for (int x = 0; x < tileGrid.Columns; x++)
        {
            for (int y =0; y < tileGrid.Rows; y++)
            {
                if (tileGrid.Get(x, y) != null && tileGrid.Get(x, y) is WallTile)
                {
                    if(tileGrid.Get(x + 1, y) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position + new Vector3(102/*100+modelDepth*/, 0, 0);
                    }
                    else if(tileGrid.Get(x, y + 1) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position + new Vector3(0, 0, 102);
                    }

                    else if(tileGrid.Get(x - 1, y) is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position - new Vector3(102, 0, 0);
                    }
                    else if(tileGrid.Get(x, y - 1)is PathTile)
                    {
                        note.Position = tileGrid.Get(x, y).Position - new Vector3(0, 0, 102);
                    }
                }
            }
        }
    }