Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     won          = FindObjectOfType <win>();
     health       = GetComponent <enemyheath>();
     navmeshagent = GetComponent <NavMeshAgent>();
     GetComponent <Animator>().SetTrigger("idle");
 }
Beispiel #2
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            player.Location = Control.MousePosition;
            player.Top      = player.Top - 20;
            if (player.Bounds.IntersectsWith(p1.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p2.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p3.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p4.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p5.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p6.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }

            if (player.Bounds.IntersectsWith(p15.Bounds))
            {
                play.Stop();
                timer1.Stop();
                timer2.Stop();
                timer1.Stop();
                this.Hide();
                win f1 = new win(s);
                f1.Show();
                timer2.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p7.Bounds))
            {
                player.Top     = 42;
                player.Left    = 482;
                timer2.Enabled = false;
            }
        }
Beispiel #3
0
    private void OnEnable()
    {
        if (!instance)
        {
            instance = this;
        }

        GenerateLevel();
    }
Beispiel #4
0
        private int P1Win()
        {
            int winCon = 0;

            if (a1c == 1 && a2c == 1 && a3c == 1)
            {
                winCon = 1;
            }
            else if (b1c == 1 && b2c == 1 && b3c == 1)
            {
                winCon = 1;
            }
            else if (c1c == 1 && c2c == 1 && c3c == 1)
            {
                winCon = 1;
            }
            else if (a1c == 1 && b1c == 1 && c1c == 1)
            {
                winCon = 1;
            }
            else if (a2c == 1 && b2c == 1 && c2c == 1)
            {
                winCon = 1;
            }
            else if (a3c == 1 && b3c == 1 && c3c == 1)
            {
                winCon = 1;
            }
            else if (a1c == 1 && b2c == 1 && c3c == 1)
            {
                winCon = 1;
            }
            else if (a3c == 1 && b2c == 1 && c1c == 1)
            {
                winCon = 1;
            }


            if (winCon == 1)
            {
                this.Hide();
                win gotoWin = new win();
                gotoWin.ShowDialog();
                this.Close();
            }
            else if (a1c != 0 && a2c != 0 && a3c != 0 && b1c != 0 && b2c != 0 && b3c != 0 && c1c != 0 && c2c != 0 && c3c != 0)
            {
                this.Hide();
                Draw gotoDraw = new Draw();
                gotoDraw.ShowDialog();
                this.Close();
            }
            return(winCon);
        }
Beispiel #5
0
    // Start is called before the first frame update
    void Start()
    {
        damageCalc = gameObject.GetComponent <damageCalculate>();
        winning    = GameObject.FindGameObjectWithTag("win").GetComponent <win>();

        if (Random.Range(0, 2) == 0)
        {
            transform.position = position1;
            beginning          = false;
        }
        else
        {
            transform.position = position2;
            beginning          = false;
        }
        // it hides and locks the curser during the game mode
        Cursor.lockState = CursorLockMode.Locked;
    }
Beispiel #6
0
        win GetWin(Process process, string winText)
        {
            var app = GetApp(process);

            if (app.wins.TryGetValue(winText, out var win))
            {
                return(win);
            }

            var data = db.ExecuteDynamic(
                "select id from win where appid=@appid and text=@winText",
                new SQLiteParameter("appid", app.id),
                new SQLiteParameter("winText", winText)
                ).FirstOrDefault();

            if (data == null)
            {
                if (nextWinId == 0)
                {
                    nextWinId = (int)(long)db.ExecuteData("select ifnull(max(id),0) + 1 from win")[0][0];
                }
                db.Execute(
                    "insert into win (id, appId, text) values(@id, @appId, @text)",
                    new SQLiteParameter("id", nextWinId),
                    new SQLiteParameter("appId", app.id),
                    new SQLiteParameter("text", winText)
                    );
                win = new win {
                    id = nextWinId, text = winText
                };
                nextWinId++;
            }
            else
            {
                win = new win
                {
                    id   = data.id,
                    text = winText
                };
            }

            app.wins.Add(winText, win);
            return(win);
        }
Beispiel #7
0
        private void timermain_Tick(object sender, EventArgs e)
        {
            player.Location = Control.MousePosition;
            player.Top      = player.Top - 20;
            if (player.Bounds.IntersectsWith(p1.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p2.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p3.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p4.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p5.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p6.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p7.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p8.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p9.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p10.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p11.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p12.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p13.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(p15.Bounds))
            {
                play.Stop();
                timer2.Stop();
                this.Hide();
                win f1 = new win(s);
                f1.Show();
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(pictureBox1.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }
            if (player.Bounds.IntersectsWith(pictureBox2.Bounds))
            {
                player.Top        = 35;
                player.Left       = 678;
                timermain.Enabled = false;
            }

            if (player.Bounds.IntersectsWith(pp.Bounds))
            {
                flag3 = 1;
            }
        }
Beispiel #8
0
 internal void goTo(win state)
 {
     currState = state;
 }
Beispiel #9
0
 internal win update()
 {
     return(currState = getNextState[((int)currState)]());
 }
Beispiel #10
0
 internal WinStateMachine()
 {
     currState = win.sleep;
     //fill array with functions
     getNextState = new machine[] { Sleep, Restart, Quit };
 }
Beispiel #11
0
        public win.Result DoWork(string Program, string Input, string Compiler_args, win.Languages Language)
        {
            using (var service = new win.Service())
            {
                try
                {
                    bool ProgramCompressed = false;
                    if (!string.IsNullOrEmpty(Program) && Program.Length > 1000)
                    {
                        ProgramCompressed = true;
                        Program = GlobalUtils.Utils.Compress(Program);
                    }
                    bool InputCompressed = false;
                    if (!string.IsNullOrEmpty(Input) && Input.Length > 1000)
                    {
                        InputCompressed = true;
                        Input = GlobalUtils.Utils.Compress(Input);
                    }

                    bool bytes = true;
                    var res = service.DoWork(Program, Input, Language, GlobalUtils.TopSecret.Service_user, GlobalUtils.TopSecret.Service_pass, Compiler_args, bytes, ProgramCompressed, InputCompressed);

                    if (bytes)
                    {
                        if (res.Errors_Bytes != null)
                            res.Errors = System.Text.Encoding.Unicode.GetString(res.Errors_Bytes);
                        if (res.Warnings_Bytes != null)
                            res.Warnings = System.Text.Encoding.Unicode.GetString(res.Warnings_Bytes);
                        if (res.Output_Bytes != null)
                            res.Output = System.Text.Encoding.Unicode.GetString(res.Output_Bytes);
                    }
                    if (res.IsOutputCompressed)
                        res.Output = GlobalUtils.Utils.Decompress(res.Output);

                    return res;
                }
                catch (Exception ex)
                {
                    return new win.Result()
                    {
                        System_Error = string.Format("Error while calling service: {0}", ex.Message)
                    };
                }
            }
        }
Beispiel #12
0
        private void timermain_Tick(object sender, EventArgs e)
        {
            player.Location = Control.MousePosition;
            player.Top      = player.Top - 20;

            if (player.Bounds.IntersectsWith(p1.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p2.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p3.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p4.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p5.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p6.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p7.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p8.Bounds))
            {
                player.Top  = 45;
                player.Left = 507;
                //main.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p9.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p10.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p11.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }

            /*    if (player.Bounds.IntersectsWith(p12.Bounds))
             *  {
             *      player.Top = 14;
             *      player.Left = 348;
             *      timermain.Enabled = false;
             *      // pictureBox27.Visible = true;
             *  }*/
            if (player.Bounds.IntersectsWith(p13.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p13.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p14.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p15.Bounds))
            {
                player.Top        = 45;
                player.Left       = 348;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p16.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p17.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p17.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p18.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p19.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p20.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p21.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p22.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p23.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(p25.Bounds))
            {
                player.Top        = 45;
                player.Left       = 507;
                timermain.Enabled = false;
                // pictureBox27.Visible = true;
            }
            if (player.Bounds.IntersectsWith(pp.Bounds))
            {
                play.Stop();
                timer2.Stop();
                this.Hide();
                win f1 = new win(s);
                f1.Show();
                timermain.Enabled = false;
            }
        }
Beispiel #13
0
 // Use this for initialization
 void Start()
 {
     rb        = GetComponent <Rigidbody>();
     winscript = GetComponent <win>();
 }
Beispiel #14
0
 void Awake()
 {
     Win = FindObjectOfType<win> ();
     pause = FindObjectOfType<PauseMenu> ();
 }