Example #1
0
        public static void Main(string[] args)
        {
            var Ball1 = new Snaryad(VvodChisla(), VvodChisla(), VvodChisla(), VvodChisla());

            Ball1.CoordinatesVelocity();
            var Pushka = new Snaryad(VvodChisla(), VvodChisla(), VvodChisla(), VvodChisla());

            Pushka.CoordinatesVelocity();

            Console.ReadLine();
        }
Example #2
0
        public static void Main(string[] args)
        {
            var Ball1 = new Snaryad(VvodChisla(), VvodChisla(), VvodChisla(), VvodChisla());

            Ball1.CoordinatesVelocity();
            var Pushka = new Snaryad(VvodChisla(), VvodChisla(), VvodChisla(), VvodChisla());

            Pushka.CoordinatesVelocity();

            ParametriCollisii(Ball1.NachalnayaCoordinataX, Ball1.NachalnayaCoordinataY, Ball1.Radius, Ball1.Velocity, Pushka.NachalnayaCoordinataX, Pushka.NachalnayaCoordinataY, Pushka.Radius, Pushka.Velocity);


            Console.ReadLine();
        }
        public static void Main(string[] args)
        {
            var Ball1 = new Snaryad(VvodChisla(), VvodChisla(), VvodChisla(), VvodChisla());

            Ball1.CoordinatesVelocity();
            var Pushka = new Snaryad(VvodChisla(), VvodChisla(), VvodChisla(), VvodChisla());

            Pushka.CoordinatesVelocity();
            bool result = Collision(Ball1.NachalnayaCoordinataX, Ball1.NachalnayaCoordinataY, Ball1.Radius, Pushka.NachalnayaCoordinataX, Pushka.NachalnayaCoordinataY, Pushka.Radius);

            if (result)
            {
                Console.Out.WriteLine("Collision Detected!");
            }
            else
            {
                Console.Out.WriteLine("Collision not detected!");
            }

            Console.ReadLine();
        }