Пример #1
0
        private void InitTextBox(Phisics ph)
        {
            //масс
            textBoxMass.Text           = ph.NoCI_mass(ph.m_item).ToString();
            comboBoxMass.SelectedIndex = ph.m_item;

            //положение
            textBoxPosition.Text           = ph.NoCI_q0(ph.q0_item).ToString();
            comboBoxPosition.SelectedIndex = ph.q0_item;

            //скорость
            textBoxSpeed.Text           = ph.NoCI_dq0(ph.dq0_item).ToString();
            comboBoxSpeed.SelectedIndex = ph.dq0_item;

            //коэф пружины
            textBoxQuotSpring.Text           = ph.k.ToString();
            comboBoxQuotSpring.SelectedIndex = ph.k_item;

            //коэф затухания
            textBoxQuatFading.Text           = ph.c.ToString();
            comboBoxQuatFading.SelectedIndex = ph.c_item;

            //время
            textBoxTime.Text           = ph.NoCI_time(ph.time_item).ToString();
            comboBoxTime.SelectedIndex = ph.time_item;

            //промежутки времени
            textBoxTimeStep.Text           = ph.NoCI_timeInterval(ph.time_interval_item).ToString();
            comboBoxTimeStep.SelectedIndex = ph.time_interval_item;
        }
Пример #2
0
        private void optoinsMenu_Click(object sender, EventArgs e)
        {
            listPoints.Clear();
            Options form = new Options(phisics);

            form.ShowDialog();
            phisics    = form.phisics;
            listPoints = points.PointsList(phisics);
        }
Пример #3
0
    // Update is called once per frame
    void FixedUpdate()
    {
        // Take bodies
        OwnRigid playerBody = player.GetComponent <OwnRigid>();
        OwnRigid pickBody   = gameObject.GetComponent <OwnRigid>();
        Phisics  pEngine    = engine.GetComponent <Phisics>();

        // If player body and coin body collide, remove coin and increase score
        if (AABBvsAABB(playerBody.boundary, pickBody.boundary))
        {
            gameObject.SetActive(false);
            pEngine.count++;
            pEngine.countText.text = "Score: " + pEngine.count.ToString();
        }
    }
Пример #4
0
    // Update is called once per frame
    void FixedUpdate()
    {
        OwnRigid playerBody = player.GetComponent <OwnRigid>();
        OwnRigid end        = gameObject.GetComponent <OwnRigid>();
        Phisics  pEngine    = engine.GetComponent <Phisics>();


        if (AABBvsAABB(playerBody.boundary, end.boundary))
        {
            if (pEngine.count > 5)
            {
                pEngine.message.gameObject.SetActive(true);
                pEngine.next.gameObject.SetActive(true);
            }
        }
    }
Пример #5
0
    // Update is called once per frame
    void FixedUpdate()
    {
        // Get components
        OwnRigid playerBody = GetComponent <OwnRigid>();
        Phisics  handler    = engine.GetComponent <Phisics>();


        // Left
        if (Input.GetKey(KeyCode.A))
        {
            playerBody.velocity.x += -speed * Time.deltaTime;
        }

        // Right
        if (Input.GetKey(KeyCode.D))
        {
            playerBody.velocity.x += +speed * Time.deltaTime;
        }

        // Release Movement Left or Right
        if (Input.GetKeyUp(KeyCode.A) || Input.GetKeyUp(KeyCode.D))
        {
            playerBody.velocity.x = 0.0f;
        }

        // if not in air, player can jump
        if (handler.grounded)
        {
            JumpSpeed = 200;

            if (Input.GetKeyDown(KeyCode.Space))
            {
                playerBody.velocity.y += JumpSpeed * Time.deltaTime;
            }
            if (JumpSpeed == 200)
            {
                handler.grounded = false;
            }
            if (handler.grounded == false)
            {
                JumpSpeed = 0;
            }
        }
    }
Пример #6
0
        public Form1()
        {
            InitializeComponent();
            panelTable.Location = panelGraf.Location = new Point(12, 27);
            panelTable.Size     = panelGraf.Size = new Size(776, 411);
            dataGridView1.Size  = chart1.Size = new Size(770, 405);
            phisics             = new Phisics();
            listPoints          = new List <Points>();
            points   = new Points();
            settings = new Settings();

            listPoints = points.PointsList(phisics);
            SetSetting();
            GrafMenu.PerformClick();

            Timer timer = new Timer();

            timer.Interval += 1000;
            timer.Tick     += new EventHandler(Point);
            timer.Start();
        }
Пример #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     phisics = phisics_save;
     Close();
 }
Пример #8
0
 public Options(Phisics ph)
 {
     InitializeComponent();
     InitTextBox(ph);
     phisics_save = ph;
 }