Beispiel #1
0
            public double distanceTo(SinPoint point)
            {
                var r = point.x - x;
                var h = point.y - y;

                return(Math.Sqrt(r * r + h * h));
            }
Beispiel #2
0
                public wa()
                {
                    var random = new Random();

                    position     = new SinPoint(0, 0);
                    offset       = new SinPoint(0, 0);
                    originalSize = size = (int)(6 + random.NextDouble() * 4);
                    force        = 1 + random.NextDouble() * 0.4;
                }
Beispiel #3
0
                public fa()
                {
                    var random = new Random();

                    position = new SinPoint(0, 0);
                    size     = (int)(20 + random.NextDouble() * 4);
                    force    = 0.8 + random.NextDouble() * 0.4;

                    type = randomizeType();
                }
        }//Английский

        //public event PropertyChangedEventHandler PropertyChanged;
        //public void OnPropertyChanged([CallerMemberName]string prop = "")
        //{
        //    if (PropertyChanged != null)
        //        PropertyChanged(this, new PropertyChangedEventArgs(prop));
        //}

        private void timerTick(object sender, EventArgs e)
        {
            deltime = (500d / Tsteps) * Tstep++;
            CosPoint.Add(new DataPoint(Tstep, cos.CalcAcceleration(500, deltime, 500) * 10000));
            SinPoint.Add(new DataPoint(Tstep, sin.CalcAcceleration(500, deltime, 500) * 10000));
            LinearPoint.Add(new DataPoint(Tstep, linear.CalcAcceleration(500, deltime, 500) * 10000));
            ConstPoint.Add(new DataPoint(Tstep, const_.CalcAcceleration(500, deltime, 500) * 10000));
            if (Tsteps == Tstep)
            {
                timer.Stop();
            }
        }
Beispiel #5
0
 public ga()
 {
     gaPosition    = new SinPoint(0, 0);
     size          = 8;
     shield        = 0;
     lives         = 2;
     gravitywarped = false;
     gravityfactor = 0;
     timewarped    = false;
     timefactor    = 0;
     sizewarped    = false;
     sizefactor    = 0;
 }
Beispiel #6
0
 public void clonePosition(ref SinPoint point)
 {
     point.x = x;
     point.y = y;
 }