ChangeDirectionElement which makes the player go left.
Inheritance: ChangeDirectionElement
    public void MoveScroll(bool right)
    {
        float x;

        if (right)
        {
            LeftArrow.SetActive(true);
            Vector3 newPos = Grid.GetComponent <RectTransform>().localPosition;
            newPos.x -= ScrollbarSeparateValue;
            Grid.GetComponent <RectTransform>().localPosition = newPos;
            CurrentScrollbarValue++;
            if (CurrentScrollbarValue >= CurrentGridChild)
            {
                RightArrow.SetActive(false);
            }
        }
        else
        {
            RightArrow.SetActive(true);
            Vector3 newPos = Grid.GetComponent <RectTransform>().localPosition;
            newPos.x += ScrollbarSeparateValue;
            Grid.GetComponent <RectTransform>().localPosition = newPos;
            CurrentScrollbarValue--;
            if (CurrentScrollbarValue <= 4)
            {
                LeftArrow.SetActive(false);
            }
        }
    }
Exemple #2
0
        public void EnterDate()
        {
            while (Month.Text != "March")
            {
                LeftArrow.Click();
            }

            FirstDayOfMonth.Click();
        }
    // Use this for initialization
    private void Start()
    {
        SaveDataManager.Instance.LoadSaveData();

        selectStage = SelectStage.NOT_SELECT;

        stageScript[(int)Stages.STAGE_T1] = GameObject.Find("stage_tutorial1_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_T2] = GameObject.Find("stage_tutorial2_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_T3] = GameObject.Find("stage_tutorial3_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_1]  = GameObject.Find("stage_1_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_2]  = GameObject.Find("stage_2_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_3]  = GameObject.Find("stage_3_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_4]  = GameObject.Find("stage_4_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_5]  = GameObject.Find("stage_5_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_6]  = GameObject.Find("stage_6_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_7]  = GameObject.Find("stage_7_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_8]  = GameObject.Find("stage_8_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_9]  = GameObject.Find("stage_9_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_10] = GameObject.Find("stage_10_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_11] = GameObject.Find("stage_11_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_12] = GameObject.Find("stage_12_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_E1] = GameObject.Find("stage_extra1_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_E2] = GameObject.Find("stage_extra2_image").GetComponent <StageImage>();
        stageScript[(int)Stages.STAGE_E3] = GameObject.Find("stage_extra3_image").GetComponent <StageImage>();

        stageSelectPlayer     = GameObject.Find("StageSelectPlayer").GetComponent <StageSelectPlayer>();
        playerDefaultPosition = stageSelectPlayer.gameObject.GetComponent <Transform>().position;
        startButton           = GameObject.Find("StartButton").GetComponent <StartButton>();

        mainCamraTransform          = GameObject.Find("Main Camera").GetComponent <Transform>();
        stageSelectCameraPosition   = GameObject.Find("Page1").GetComponent <Transform>().position;
        stageSelectCameraPosition.z = -10;
        stageDetailCameraPosition   = GameObject.Find("StageDetailBackGround").GetComponent <Transform>().position;
        stageDetailCameraPosition.z = -10;

        this.stageDetail = GameObject.Find("ViewStageDetail").GetComponent <StageDetailManager>();

        nowPage    = 1;
        rightArrow = GameObject.Find("RightArrow").GetComponent <RightArrow>();
        leftArrow  = GameObject.Find("LeftArrow").GetComponent <LeftArrow>();
        tapFlag    = false;
        pageSet    = GameObject.Find("PageSet");
        //MovePage(); //他のシーンから戻った際に初期ページ位置変更

        this.audioClip         = new CustomAudioClip[(int)AudioList.AUDIO_MAX];
        this.audioClip[0].Clip = Resources.Load("Audio/BGM/BGM_StageSelect", typeof(AudioClip)) as AudioClip;
        this.audioClip[0].Vol  = 1.0f;

        this.sourceAudio         = this.gameObject.AddComponent <SourceAudio>();
        this.sourceAudio.m_Audio = this.audioClip;

        this.sourceAudio.PlayBGM((int)AudioList.AUDIO_BGM, true);

        CheckUnLock();
    }
Exemple #4
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            limite = 4;
            turno  = 1;
            RightArrow.Hide();
            LeftArrow.Show();
            Undo.Show();
            for (int i = 1; i < 7; i++)
            {
                Reset(1, i);
                Reset(2, i);
            }

            Columna1[0].Location = new System.Drawing.Point(70, 95);
            Columna2[0].Location = new System.Drawing.Point(170, 95);

            Columna1[4].Text      = Columna1[6].Text = r.Next(1, limite).ToString();
            Columna1[4].BackColor = Columna1[6].BackColor = Colores[int.Parse(Columna1[4].Text) % 10];
            int ran = r.Next(1, limite);

            while (ran == int.Parse(Columna1[4].Text))
            {
                ran = r.Next(1, limite);
            }
            Columna1[5].Text      = ran.ToString();
            Columna1[5].BackColor = Colores[int.Parse(Columna1[5].Text) % 10];
            Columna2[4].Text      = Columna2[6].Text = r.Next(1, limite).ToString();
            Columna2[4].BackColor = Columna2[6].BackColor = Colores[int.Parse(Columna2[4].Text) % 10];
            while (ran == int.Parse(Columna2[4].Text))
            {
                ran = r.Next(1, limite);
            }
            Columna2[5].Text      = ran.ToString();
            Columna2[5].BackColor = Colores[int.Parse(Columna2[5].Text) % 10];

            Columna1[0].Text      = r.Next(1, limite).ToString();
            Columna1[0].BackColor = Colores[int.Parse(Columna1[0].Text) % 10];
            Columna2[0].Text      = r.Next(1, limite).ToString();
            Columna2[0].BackColor = Colores[int.Parse(Columna2[0].Text) % 10];
            Next.Text             = r.Next(1, limite).ToString();
            Next.BackColor        = Colores[int.Parse(Next.Text) % 10];
            label1.Text           = "0";
            score = 0;

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    saved[i][j] = 0;
                }
            }
            Save();
            gameOver = false;
        }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        InitializeActive();
        StartCoroutine("TitleAnimation");
        InitializeButton();

        RightArrow.GetComponent <Button>().onClick.AddListener(RightArrow_Touch);
        LeftArrow.GetComponent <Button>().onClick.AddListener(LeftArrow_Touch);
        Batsu.GetComponent <Button>().onClick.AddListener(Batsu_Touch);

        AudioManager.Instance.PlayBGM("Title");
    }
Exemple #6
0
 public void PrevPage()
 {
     page = Mathf.Max(page - 1, 0);
     if (page == 0)
     {
         LeftArrow.GetComponent <Image>().color = Color.clear;
     }
     else
     {
         RightArrow.GetComponent <Image>().color = new Color(255, 255, 255, 255);
     }
     LoadPage();
 }
Exemple #7
0
 public void NextPage()
 {
     page = Mathf.Min(page + 1, max_pages - 1);
     if (page == max_pages - 1)
     {
         RightArrow.GetComponent <Image>().color = Color.clear;
     }
     else
     {
         LeftArrow.GetComponent <Image>().color = new Color(255, 255, 255, 255);
     }
     LoadPage();
 }
Exemple #8
0
 public void OnRightArrow()
 {
     for (int i = 0; i < InstructionScreens.Length; i++)
     {
         InstructionScreens[i].SetActive(false);
     }
     showscreen++;
     InstructionScreens[showscreen].SetActive(true);
     if (showscreen == InstructionScreens.Length - 1)
     {
         RightArrow.SetActive(false);
     }
     LeftArrow.SetActive(true);
 }
        private void InitViews()
        {
            if (LeftArrow != null)
            {
                LeftArrow.Click -= LeftArrow_Click;
                LeftArrow.Click += LeftArrow_Click;
                LeftArrow?.SetImageFromResource(DrawableConstants.LeftEventArrow);
            }

            if (RightArrow != null)
            {
                RightArrow.Click -= RightArrow_Click;
                RightArrow.Click += RightArrow_Click;
                RightArrow?.SetImageFromResource(DrawableConstants.RightEventArrow);
            }

            if (MonthText != null)
            {
                MonthText.Text = EventManager.Instance.IsDay == EventType.Day ? EventManager.Instance.CurrentDateTime.ToString("MMMM") : FormatDateTime(EventManager.Instance.CurrentDateTime);

                MonthText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size28);
                MonthText.SetTextColor(ColorConstants.WhiteColor);
            }

            if (IntervalEventsDate == null)
            {
                return;
            }
#if __ANDROID__
            IntervalEventsDate.Text = EventManager.Instance.IsDay == EventType.Day ? "today events".ToUpperInvariant() : "month events".ToUpperInvariant();
#else
            if (EventManager.Instance.IsDay == EventType.Day)
            {
                IntervalEventsDate.Text = "   today events   ".ToUpperInvariant();
            }
            else
            {
                IntervalEventsDate.Text = "   month events   ".ToUpperInvariant();
            }
#endif

            IntervalEventsDate?.SetBackgroundColor(ColorConstants.TransparentColor, 4, ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent70), 1);
            IntervalEventsDate.SetTextColor(ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent70));
            IntervalEventsDate.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size12);
            IntervalEventsDate.SetSelectedColor(ColorConstants.WhiteColor);

            IntervalEventsDate.Click -= IntervalMonth_Click;
            IntervalEventsDate.Click += IntervalMonth_Click;
        }
Exemple #10
0
 private void Restart()
 {
     pictureBox2.Hide();
     pictureBox3.Hide();
     pictureBox4.Show();
     //pictureBox5.Show();
     Undo.Hide();
     label1.Hide();
     label4.Hide();
     Next.Hide();
     RightArrow.Hide();
     LeftArrow.Hide();
     for (int i = 0; i < 7; i++)
     {
         this.Controls.Remove(Columna1[i]);
         this.Controls.Remove(Columna2[i]);
     }
     pictureBox1.Show();
 }
Exemple #11
0
        private void Undo_Click(object sender, EventArgs e)
        {
            Undo.Hide();
            for (int i = 0; i < 7; i++)
            {
                if (saved[1][i] == 0)
                {
                    Reset(1, i);
                }
                else
                {
                    Columna1[i].Text      = saved[1][i].ToString();
                    Columna1[i].BackColor = Colores[saved[1][i] % 10];
                }

                if (saved[2][i] == 0)
                {
                    Reset(2, i);
                }
                else
                {
                    Columna2[i].Text      = saved[2][i].ToString();
                    Columna2[i].BackColor = Colores[saved[2][i] % 10];
                }


                Next.Text      = saved[0][0].ToString();
                Next.BackColor = Colores[saved[0][0] % 10];
                turno          = saved[0][1];
                score          = saved[0][2];
            }
            if (turno == 1)
            {
                RightArrow.Hide();
                LeftArrow.Show();
            }
            else
            {
                RightArrow.Show();
                LeftArrow.Hide();
            }
            label1.Text = score.ToString();
        }
Exemple #12
0
 public void CrossMonkeys()
 {
     if (RightCount > 0 && LeftCount == 0 && MonkeysOnRope == 0)
     {
         ShowArrow();
         ShowMonkey();
         MonkeysOnRope++;
         Assert.AreEqual(1, MonkeysOnRope);
         RightCount = (RightCount - 1);
         Assert.AreEqual(RightCount - 1, RightCount);
     }
     else if (LeftCount > 0 && RightCount == 0 && MonkeysOnRope == 0)
     {
         ShowArrow();
         ShowMonkey();
         MonkeysOnRope++;
         Assert.AreEqual(1, MonkeysOnRope);
         LeftCount = (LeftCount - 1);
         Assert.AreEqual(LeftCount - 1, LeftCount);
     }
     else if (RightArrow.Equals(true) && MonkeysOnRope == 0)
     {
         ShowMonkey();
         MonkeysOnRope++;
         Assert.AreEqual(1, MonkeysOnRope);
         LeftCount = (LeftCount - 1);
         Assert.AreEqual(LeftCount - 1, LeftCount);
     }
     else if (LeftArrow.Equals(true) && MonkeysOnRope == 0)
     {
         ShowMonkey();
         MonkeysOnRope++;
         Assert.AreEqual(1, MonkeysOnRope);
         RightCount = (RightCount - 1);
         Assert.AreEqual(RightCount - 1, RightCount);
     }
     else if (MonkeysOnRope > 0)
     {
         MoveMonkeyForward();
     }
 }
Exemple #13
0
 public void MoveMonkeyForward()
 {
     if (MonkeysOnRope < 3 && !FinishCrossing)
     {
         if (LeftArrow.Equals(true) && RightCount > 0)
         {
             if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(1, MonkeysOnRope);
                 RightCount = (RightCount - 1);
                 Assert.AreEqual(RightCount - 1, RightCount);
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(2, MonkeysOnRope);
                 RightCount = (RightCount - 1);
                 Assert.AreEqual(RightCount - 1, RightCount);
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(3, MonkeysOnRope);
                 RightCount = (RightCount - 1);
                 Assert.AreEqual(RightCount - 1, RightCount);
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(3, MonkeysOnRope);
                 RightCount = (RightCount - 1);
                 Assert.AreEqual(RightCount - 1, RightCount);
             }
         }
         else if (LeftArrow.Equals(true) && RightCount == 0)
         {
             if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(false))//One monkey
             {
                 ShowMonkey();
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(true))
             {
                 LeftCount = (LeftCount + 1);
                 Assert.AreEqual(LeftCount + 1, LeftCount);
                 MonkeysOnRope--;
                 Assert.AreEqual(0, MonkeysOnRope);
                 HideMonkey();
                 HideArrow();
                 ShowArrow();
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 LeftCount = (LeftCount + 1);
                 Assert.AreEqual(LeftCount + 1, LeftCount);
                 MonkeysOnRope--;
                 Assert.AreEqual(1, MonkeysOnRope);
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 LeftCount = (LeftCount + 1);
                 Assert.AreEqual(LeftCount + 1, LeftCount);
                 MonkeysOnRope--;
                 Assert.AreEqual(2, MonkeysOnRope);
                 HideMonkey();
             }
         }
         if (RightArrow.Equals(true) && LeftCount > 0)
         {
             if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(1, MonkeysOnRope);
                 LeftCount = (LeftCount - 1);
                 Assert.AreEqual(LeftCount - 1, LeftCount);
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(true))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(2, MonkeysOnRope);
                 LeftCount = (LeftCount - 1);
                 Assert.AreEqual(LeftCount - 1, LeftCount);
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(3, MonkeysOnRope);
                 LeftCount = (LeftCount - 1);
                 Assert.AreEqual(LeftCount - 1, LeftCount);
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 MonkeysOnRope++;
                 Assert.AreEqual(3, MonkeysOnRope);
                 LeftCount = (LeftCount - 1);
                 Assert.AreEqual(LeftCount - 1, LeftCount);
             }
         }
         else if (RightArrow.Equals(true) && LeftCount == 0)
         {
             if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(true))
             {
                 ShowMonkey();
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(false))
             {
                 ShowMonkey();
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(false))
             {
                 RightCount = (RightCount + 1);
                 Assert.AreEqual(RightCount + 1, RightCount);
                 MonkeysOnRope--;
                 Assert.AreEqual(0, MonkeysOnRope);
                 HideMonkey();
                 HideArrow();
                 ShowArrow();
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 ShowMonkey();
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(false))
             {
                 RightCount = (RightCount + 1);
                 Assert.AreEqual(RightCount + 1, RightCount);
                 MonkeysOnRope--;
                 Assert.AreEqual(1, MonkeysOnRope);
                 HideMonkey();
             }
             else if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 HideMonkey();
                 RightCount = (RightCount + 1);
                 Assert.AreEqual(RightCount + 1, RightCount);
                 MonkeysOnRope--;
                 Assert.AreEqual(2, MonkeysOnRope);
             }
         }
     }
     else if (MonkeysOnRope == 3 || FinishCrossing)
     {
         if (LeftArrow.Equals(true))
         {
             if (LeftCount > 0)
             {
                 FinishCrossing = true;
             }
             if (RopeRightMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 HideMonkey();
                 MonkeysOnRope--;
                 Assert.AreEqual(2, MonkeysOnRope);
                 LeftCount = (LeftCount + 1);
                 Assert.AreEqual(LeftCount + 1, LeftCount);
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeLeftMonkey.Equals(true))
             {
                 HideMonkey();
                 MonkeysOnRope--;
                 Assert.AreEqual(1, MonkeysOnRope);
                 LeftCount = (LeftCount + 1);
                 Assert.AreEqual(LeftCount + 1, LeftCount);
             }
             else if (RopeRightMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeLeftMonkey.Equals(true))
             {
                 HideMonkey();
                 MonkeysOnRope--;
                 Assert.AreEqual(0, MonkeysOnRope);
                 LeftCount = (LeftCount + 1);
                 Assert.AreEqual(LeftCount + 1, LeftCount);
                 HideArrow();
                 ShowArrow();
                 FinishCrossing = false;
             }
         }
         else if (RightArrow.Equals(true))
         {
             if (RightCount > 0)
             {
                 FinishCrossing = true;
                 Assert.AreEqual(true, FinishCrossing);
             }
             if (RopeLeftMonkey.Equals(true) && RopeCenterMonkey.Equals(true) && RopeRightMonkey.Equals(true))
             {
                 HideMonkey();
                 MonkeysOnRope--;
                 Assert.AreEqual(2, MonkeysOnRope);
                 RightCount = (RightCount + 1);
                 Assert.AreEqual(RightCount + 1, RightCount);
             }
             else if (RopeLeftMonkey.Equals(false) && RopeCenterMonkey.Equals(true) && RopeRightMonkey.Equals(true))
             {
                 HideMonkey();
                 MonkeysOnRope--;
                 Assert.AreEqual(1, MonkeysOnRope);
                 RightCount = (RightCount + 1);
                 Assert.AreEqual(RightCount + 1, RightCount);
             }
             else if (RopeLeftMonkey.Equals(false) && RopeCenterMonkey.Equals(false) && RopeRightMonkey.Equals(true))
             {
                 HideMonkey();
                 MonkeysOnRope--;
                 Assert.AreEqual(0, MonkeysOnRope);
                 RightCount = (RightCount + 1);
                 Assert.AreEqual(RightCount + 1, RightCount);
                 HideArrow();
                 ShowArrow();
                 FinishCrossing = false;
                 Assert.AreEqual(false, FinishCrossing);
             }
         }
     }
 }
Exemple #14
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = AppColors.LIGHT_TEAL;
            // Perform any additional setup after loading the view, typically from a nib.

            /*
             * Initialize the gesture recongizers
             */
            UISwipeGestureRecognizer SwipeRight = new UISwipeGestureRecognizer(Prev);

            SwipeRight.Direction = UISwipeGestureRecognizerDirection.Right;


            UISwipeGestureRecognizer SwipeLeft = new UISwipeGestureRecognizer(Next);

            SwipeLeft.Direction = UISwipeGestureRecognizerDirection.Left;

            UITapGestureRecognizer doubleTap = new UITapGestureRecognizer(HandleDoubleTap);

            doubleTap.NumberOfTapsRequired = 2;

            UITapGestureRecognizer singleTapRight = new UITapGestureRecognizer(HandleRightArrowClick);

            singleTapRight.NumberOfTapsRequired = 1;

            UITapGestureRecognizer singleTapLeft = new UITapGestureRecognizer(HandleLeftArrowClick);

            singleTapLeft.NumberOfTapsRequired = 1;


            /*Show image in ImageViewSessionView from ImageDatabase
             * get all image stacks from the category
             */

            List <ImageStackCategory> ImageStacks = new DatabaseContext <ImageStackCategory>().GetQuery("SELECT * From ImageStackCategory WHERE ParentCategoryID = ?", CurrentCategory.ID.ToString());

            //Get all images from that image stack
            foreach (ImageStackCategory imageStack in ImageStacks)
            {
                ImageStackNames.Add(imageStack.ImageStackName.ToString());
                List <ImageStackImages> ImageStackList = new DatabaseContext <ImageStackImages>().GetQuery("SELECT * From ImageStackImages WHERE ParentImageStackID =? Order By ImageStackIndex ASC", imageStack.ID.ToString());

                //randomize images if enabled
                if (imageStack.RandomizeImageStack)
                {
                    ImageStackList = RandomizeImageStackIfEnabled(ImageStackList);
                }
                ImageStack2D.Add(ImageStackList);
            }
            MissedButton.TouchUpInside += (sender, e) => Missed();
            UIImage missedImageBtn = UIImage.FromFile("Incorrect-Icon.png");

            MissedButton.SetImage(missedImageBtn, UIControlState.Normal);

            PromptedButton.TouchUpInside += (sender, e) => Prompted();
            UIImage promptedBtn = UIImage.FromFile("Help-Icon.png");

            PromptedButton.SetImage(promptedBtn, UIControlState.Normal);

            IndependentButton.TouchUpInside += (sender, e) => Independent();
            UIImage independentBtn = UIImage.FromFile("Individual-Icon.png");

            IndependentButton.SetImage(independentBtn, UIControlState.Normal);

            FinishedButton.TouchUpInside += (sender, e) =>
            {
                /*
                 * Finished Button Handler
                 * Return to the homescreen.
                 */
                finishedScreen.setSession(_Session);
                finishedScreen.setAttempted(_Attempted);
                finishedScreen.setCorrect(_Correct);
                Parent.DismissViewController(true, null);
                Parent.PresentViewController(finishedScreen, true, null);
            };
            LeftArrow.AddGestureRecognizer(singleTapLeft);
            LeftArrow.UserInteractionEnabled = true;
            RightArrow.AddGestureRecognizer(singleTapRight);
            RightArrow.UserInteractionEnabled = true;

            /*
             * Add the Gesture Recognizers to the ImageViewSession Only.
             */
            View.UserInteractionEnabled = true;
            View.AddGestureRecognizer(doubleTap);
            View.AddGestureRecognizer(SwipeRight);
            View.AddGestureRecognizer(SwipeLeft);

            if (!CurrentProfile.showLabelSettings)
            {
                //hide the label
                ImageLabel.Hidden      = true;
                imageStackLabel.Hidden = true;
            }
            if (!CurrentProfile.showImageSettings)
            {
                //hide the image
                ImageViewSession.Alpha = 0.0f;
            }
            StartSession();
        }
Exemple #15
0
 private void Start()
 {
     LeftArrow.GetComponent <Image>().color = Color.clear;
     LoadPage();
 }
Exemple #16
0
        public void ListNotes(List <FNFSong.FNFNote> notes)
        {
            try
            {
                if (Form1.pnlField.InvokeRequired)
                {
                    Form1.pnlField.BeginInvoke((MethodInvoker) delegate { Form1.pnlField.Controls.Clear(); });
                }

                foreach (FNFSong.FNFNote n in notes)
                {
                    double newcurrentY = Math.Floor(remapToRange(float.Parse(n.Time.ToString()), 0,
                                                                 (float)16 * stepCrochet, 0, Form1.pnlField.Height)) % Form1.pnlField.Height;

                    switch (n.Type)
                    {
                    case FNFSong.NoteType.Left:
                    case FNFSong.NoteType.RLeft:
                        LeftArrow arrow = new LeftArrow();
                        arrow.Location = new Point(0, (int)newcurrentY);
                        if (n.Length > 0)
                        {
                            HeldPart h = new HeldPart(n);
                            h.Location = new Point(arrow.Location.X + (arrow.Width / 2) - 6, (int)newcurrentY);
                            if (Form1.pnlField.InvokeRequired)
                            {
                                Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                                {
                                    Form1.pnlField.Controls.Add(h);
                                    h.SendToBack();
                                });
                            }
                        }
                        if (Form1.pnlField.InvokeRequired)
                        {
                            Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                            {
                                Form1.pnlField.Controls.Add(arrow);
                                arrow.BringToFront();
                            });
                        }
                        break;

                    case FNFSong.NoteType.Down:
                    case FNFSong.NoteType.RDown:
                        DownArrow dArrow = new DownArrow();
                        dArrow.Location = new Point(32, (int)newcurrentY);
                        if (n.Length > 0)
                        {
                            HeldPart h = new HeldPart(n);
                            h.Location = new Point(dArrow.Location.X + (dArrow.Width / 2) - 6, (int)newcurrentY);
                            if (Form1.pnlField.InvokeRequired)
                            {
                                Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                                {
                                    Form1.pnlField.Controls.Add(h);
                                    h.SendToBack();
                                });
                            }
                        }
                        if (Form1.pnlField.InvokeRequired)
                        {
                            Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                            {
                                Form1.pnlField.Controls.Add(dArrow);
                                dArrow.BringToFront();
                            });
                        }
                        break;

                    case FNFSong.NoteType.Up:
                    case FNFSong.NoteType.RUp:
                        UpArrow uArrow = new UpArrow();
                        uArrow.Location = new Point(64, (int)newcurrentY);
                        if (n.Length > 0)
                        {
                            HeldPart h = new HeldPart(n);
                            h.Location = new Point(uArrow.Location.X + (uArrow.Width / 2) - 6, (int)newcurrentY);
                            if (Form1.pnlField.InvokeRequired)
                            {
                                Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                                {
                                    Form1.pnlField.Controls.Add(h);
                                    h.SendToBack();
                                });
                            }
                        }
                        if (Form1.pnlField.InvokeRequired)
                        {
                            Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                            {
                                Form1.pnlField.Controls.Add(uArrow);
                                uArrow.BringToFront();
                            });
                        }
                        break;

                    case FNFSong.NoteType.Right:
                    case FNFSong.NoteType.RRight:
                        RightArrow rArrow = new RightArrow();
                        rArrow.Location = new Point(96, (int)newcurrentY);
                        if (n.Length > 0)
                        {
                            HeldPart h = new HeldPart(n);
                            h.Location = new Point(rArrow.Location.X + (rArrow.Width / 2) - 6, (int)newcurrentY);

                            if (Form1.pnlField.InvokeRequired)
                            {
                                Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                                {
                                    Form1.pnlField.Controls.Add(h);
                                    h.SendToBack();
                                });
                            }
                        }
                        if (Form1.pnlField.InvokeRequired)
                        {
                            Form1.pnlField.BeginInvoke((MethodInvoker) delegate
                            {
                                Form1.pnlField.Controls.Add(rArrow);
                                rArrow.BringToFront();
                            });
                        }
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Form1.WriteToConsole("Failed to render notes.\n" + e);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (FinishedButton != null)
            {
                FinishedButton.Dispose();
                FinishedButton = null;
            }

            if (ImageCountLabel != null)
            {
                ImageCountLabel.Dispose();
                ImageCountLabel = null;
            }

            if (ImageLabel != null)
            {
                ImageLabel.Dispose();
                ImageLabel = null;
            }

            if (imageStackLabel != null)
            {
                imageStackLabel.Dispose();
                imageStackLabel = null;
            }

            if (ImageViewSession != null)
            {
                ImageViewSession.Dispose();
                ImageViewSession = null;
            }

            if (IndependentButton != null)
            {
                IndependentButton.Dispose();
                IndependentButton = null;
            }

            if (LeftArrow != null)
            {
                LeftArrow.Dispose();
                LeftArrow = null;
            }

            if (MissedButton != null)
            {
                MissedButton.Dispose();
                MissedButton = null;
            }

            if (PromptedButton != null)
            {
                PromptedButton.Dispose();
                PromptedButton = null;
            }

            if (RightArrow != null)
            {
                RightArrow.Dispose();
                RightArrow = null;
            }

            if (StatsLabel != null)
            {
                StatsLabel.Dispose();
                StatsLabel = null;
            }
        }
    public void PrintGroupBtn(GroupType type = GroupType.Return_MaxGroupType)
    {
        ClearGrid();
        if (type == GroupType.Return_MaxGroupType)
        {
            for (int i = 0; i < (int)GroupType.Return_MaxGroupType; i++)
            {
                switch ((GroupType)i)
                {
                case GroupType.Pictures:
                    PrintNewBtn(GroupType.Pictures, "Imagenes");
                    break;

                case GroupType.Videos:
                    PrintNewBtn(GroupType.Videos, "Videos");
                    break;

                case GroupType.Pictures360:
                    PrintNewBtn(GroupType.Pictures360, "Imagenes 360º");
                    break;

                case GroupType.Videos360:
                    PrintNewBtn(GroupType.Videos360, "Videos 360º");
                    break;

                case GroupType.Return_MaxGroupType:
                    break;
                }
            }
        }
        else
        {
            switch (type)
            {
            case GroupType.Pictures:
            case GroupType.Pictures360:
                for (int i = 0; i < allPicture.Count; i++)
                {
                    if (allPicture[i].Type == type)
                    {
                        PrintNewBtn(allPicture[i].Type, allPicture[i].Name, i);
                    }
                }
                break;

            case GroupType.Videos:
            case GroupType.Videos360:
                for (int i = 0; i < allFilms.Count; i++)
                {
                    if (allFilms[i].Type == type)
                    {
                        PrintNewBtn(allFilms[i].Type, allFilms[i].Name, i);
                    }
                }
                break;
            }
            PrintNewBtn(GroupType.Return_MaxGroupType, "Return");
        }
        if (CurrentGridChild == 0)
        {
            CurrentGridChild = Grid.transform.childCount;
        }
        else
        {
            CurrentGridChild = Grid.transform.childCount - CurrentGridChild;
        }

        if (CurrentScrollbarValue < CurrentGridChild)
        {
            RightArrow.SetActive(true);
        }
        else
        {
            RightArrow.SetActive(false);
        }
        LeftArrow.SetActive(false);
    }
Exemple #19
0
        private void LoadGameObjects(IList<string> lines)
        {
            Rows = lines.Count;
            _gameObjects = new GameObjectBase[Rows][];
            for (var row = 0; row < Rows; row++)
            {
                Columns = lines[row].Length;
                _gameObjects[row] = new GameObjectBase[Columns];

                for (var column = 0; column < Columns; column++)
                {
                    switch (lines[row][column])
                    {
                        case '#':
                            _gameObjects[row][column] = Brick.LoadBrick(lines[row][column], row, column);
                            break;
                        case 'p':
                            Thakur.Row = column;
                            Thakur.Column = row;
                            break;
                        case 'G':
                            _gameObjects[row][column] = new Paisa(row, column);
                            break;
                        case 'E':
                            _gameObjects[row][column] = new Taaqat(row, column);
                            break;
                        case 'M':
                            _gameObjects[row][column] = new Mout(row, column);
                            break;
                        case '8':
                            _gameObjects[row][column] = new UpArrow(row, column);
                            break;
                        case '2':
                            _gameObjects[row][column] = new DownArrow(row, column);
                            break;
                        case '4':
                            _gameObjects[row][column] = new LeftArrow(row, column);
                            break;
                        case '6':
                            _gameObjects[row][column] = new RightArrow(row, column);
                            break;
                        case 'd':
                            _gameObjects[row][column] = new SabzDirwaaza(row, column);
                            _dirwaazay.Add((DirwaazaBase)_gameObjects[row][column]);
                            break;
                        case 'c':
                            _gameObjects[row][column] = new SabzChaabi(row, column);
                            _chaabiyaan.Add((ChaabiBase)_gameObjects[row][column]);
                            break;
                        case 't':
                            _gameObjects[row][column] = new SabzTaala(row, column);
                            _taalay.Add((TaalaBase)_gameObjects[row][column]);
                            break;
                        case 'D':
                            _gameObjects[row][column] = new LaalDirwaaza(row, column);
                            _dirwaazay.Add((DirwaazaBase)_gameObjects[row][column]);
                            break;
                        case 'C':
                            _gameObjects[row][column] = new LaalChaabi(row, column);
                            _chaabiyaan.Add((ChaabiBase)_gameObjects[row][column]);
                            break;
                        case 'T':
                            _gameObjects[row][column] = new LaalTaala(row, column);
                            _taalay.Add((TaalaBase)_gameObjects[row][column]);
                            break;
                        case 'V':
                            _gameObjects[row][column] = new Victory(row, column);
                            break;
                        case 'N':
                            _gameObjects[row][column] = new NextBoard(row, column);
                            break;
                    }
                }
            }
        }
Exemple #20
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            sp.PlayLooping();
            limite = 4;
            pictureBox1.Hide();
            pictureBox2.Show();
            pictureBox3.Show();
            pictureBox4.Hide();
            pictureBox5.Hide();
            LeftArrow.Show();
            label1.Show();
            label4.Show();
            Next.Show();
            RightArrow.Hide();
            LeftArrow.Show();
            Undo.Show();
            label1.Text = "0";
            turno       = 1;
            score       = 0;
            for (int i = 0; i < 7; i++)
            {
                Columna1[i]           = new Label();
                Columna1[i].Name      = i.ToString();
                Columna1[i].Size      = new Size(60, 30);
                Columna1[i].BackColor = Color.FromArgb(230, 230, 230);
                Columna1[i].TextAlign = ContentAlignment.MiddleCenter;
                Columna1[i].Font      = new Font("Microsoft Sans Serif", 16);
                Columna1[i].ForeColor = Color.White;
                Columna1[i].Location  = new System.Drawing.Point(70, i * 35 + 120);
                Columna1[i].Click    += Form1_Click;
                this.Controls.Add(Columna1[i]);
            }
            Columna1[0].Location = new System.Drawing.Point(70, 95);

            for (int i = 0; i < 7; i++)
            {
                Columna2[i]           = new Label();
                Columna2[i].Name      = i.ToString();
                Columna2[i].Size      = new Size(60, 30);
                Columna2[i].BackColor = Color.FromArgb(230, 230, 230);
                Columna2[i].TextAlign = ContentAlignment.MiddleCenter;
                Columna2[i].Font      = new Font("Microsoft Sans Serif", 16);
                Columna2[i].ForeColor = Color.White;
                Columna2[i].Location  = new System.Drawing.Point(170, i * 35 + 120);
                Columna2[i].Click    += Form2_Click;
                this.Controls.Add(Columna2[i]);
            }
            Columna2[0].Location = new System.Drawing.Point(170, 95);

            Columna1[1].BackColor = Columna2[1].BackColor = Color.FromArgb(255, 215, 215);

            Columna1[4].Text      = Columna1[6].Text = r.Next(1, limite).ToString();
            Columna1[4].BackColor = Columna1[6].BackColor = Colores[int.Parse(Columna1[4].Text) % 10];
            int ran = r.Next(1, limite);

            while (ran == int.Parse(Columna1[4].Text))
            {
                ran = r.Next(1, limite);
            }
            Columna1[5].Text      = ran.ToString();
            Columna1[5].BackColor = Colores[int.Parse(Columna1[5].Text) % 10];
            Columna2[4].Text      = Columna2[6].Text = r.Next(1, limite).ToString();
            Columna2[4].BackColor = Columna2[6].BackColor = Colores[int.Parse(Columna2[4].Text) % 10];
            while (ran == int.Parse(Columna2[4].Text))
            {
                ran = r.Next(1, limite);
            }
            Columna2[5].Text      = ran.ToString();
            Columna2[5].BackColor = Colores[int.Parse(Columna2[5].Text) % 10];

            Columna1[0].Text      = r.Next(1, limite).ToString();
            Columna1[0].BackColor = Colores[int.Parse(Columna1[0].Text) % 10];
            Columna2[0].Text      = r.Next(1, limite).ToString();
            Columna2[0].BackColor = Colores[int.Parse(Columna2[0].Text) % 10];
            Next.Text             = r.Next(1, limite).ToString();
            Next.BackColor        = Colores[int.Parse(Next.Text) % 10];
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    saved[i][j] = 0;
                }
            }
            Save();
            gameOver = false;
        }
Exemple #21
0
        private void GameUpdate()
        {
            Recorrer();
            for (int i = 1; i < 6; i++)
            {
                if (Columna1[i].Text != "" && Columna1[i].Text == Columna1[i + 1].Text)
                {
                    Columna1[i + 1].Text      = (int.Parse(Columna1[i + 1].Text) + 1).ToString();
                    Columna1[i + 1].BackColor = Colores[int.Parse(Columna1[i + 1].Text) % 10];
                    score      += (int)Math.Pow(2, int.Parse(Columna1[i + 1].Text));
                    label1.Text = score.ToString();
                    Reset(1, i);
                    Recorrer();
                    if (Columna1[i + 1].Text != "" && int.Parse(Columna1[i + 1].Text) > limite)
                    {
                        limite = int.Parse(Columna1[i + 1].Text);
                    }
                }
            }
            for (int i = 1; i < 6; i++)
            {
                if (Columna2[i].Text != "" && Columna2[i].Text == Columna2[i + 1].Text)
                {
                    Columna2[i + 1].Text      = (int.Parse(Columna2[i + 1].Text) + 1).ToString();
                    Columna2[i + 1].BackColor = Colores[int.Parse(Columna2[i + 1].Text) % 10];
                    score      += (int)Math.Pow(2, int.Parse(Columna2[i + 1].Text));
                    label1.Text = score.ToString();
                    Reset(2, i);
                    Recorrer();
                    if (Columna2[i + 1].Text != "" && int.Parse(Columna2[i + 1].Text) > limite)
                    {
                        limite = int.Parse(Columna2[i + 1].Text);
                    }
                }
            }
            Recorrer();
            if (turno == 1)
            {
                Columna1[1].Text      = Columna1[0].Text;
                Columna1[1].BackColor = Columna1[0].BackColor;
                Columna1[0].Text      = Next.Text;
                Columna1[0].BackColor = Next.BackColor;
                Next.Text             = r.Next(1, limite).ToString();
                Next.BackColor        = Colores[int.Parse(Next.Text) % 10];
                turno = 3;
                GameUpdate();
            }
            else if (turno == 2)
            {
                Columna2[1].Text      = Columna2[0].Text;
                Columna2[1].BackColor = Columna2[0].BackColor;
                Columna2[0].Text      = Next.Text;
                Columna2[0].BackColor = Next.BackColor;
                Next.Text             = r.Next(1, limite).ToString();
                Next.BackColor        = Colores[int.Parse(Next.Text) % 10];
                turno = 4;
                GameUpdate();
            }
            else if (turno == 3)
            {
                turno = 2;
                RightArrow.Show();
                LeftArrow.Hide();
            }
            else if (turno == 4)
            {
                turno = 1;
                RightArrow.Hide();
                LeftArrow.Show();
            }

            if (Columna1[1].Text != "" || Columna2[1].Text != "")
            {
                if (score > int.Parse(label3.Text))
                {
                    label3.Text = score.ToString();
                }
                if (!gameOver)
                {
                    MessageBox.Show("Juego Terminado!");
                    Restart();
                }
                gameOver = true;
            }
        }