Ejemplo n.º 1
0
        public float Height_test(Vector3 target, int item)
        {
            float heightt;


            Game1.compute_tile_point(target.X, target.Y, target.Z, (int)item);
            heightt = resolve_collision.last_index[(int)item].last_height;
            return(heightt);
        }
Ejemplo n.º 2
0
        public int crash_test(Vector3 target, int item)
        {
            int   crash;
            float heightt;


            crash   = Game1.compute_tile_point(target.X, target.Y, target.Z, (int)item);
            heightt = resolve_collision.last_index[(int)item].last_height;


            if (crash == 255)
            {
                int    crashtest1, crashtest2;
                double crashtest1_angle, crashtest2_angle;
                double wall_angle;
                crashtest1       = Game1.compute_tile_point_crash(target.X, target.Y, target.Z, (int)item);
                crashtest1_angle = Game1.crash_angle;
                crashtest2       = Game1.compute_tile_point_crash(target.X, target.Y, target.Z, (int)item);
                crashtest2_angle = Game1.crash_angle;
                if (crashtest1 == 1 && crashtest2 == 1)
                {
                    wall_angle = (crashtest1_angle + crashtest2_angle) / 2;
                }
                if (crashtest1 == 0 && crashtest2 == 1)
                {
                    wall_angle = crashtest2_angle;
                }
                if (crashtest1 == 1 && crashtest2 == 0)
                {
                    wall_angle = 0;
                }

                if (crashtest1 == 0 && crashtest2 == 0)
                {
                    wall_angle = 0;
                }

                if (crashtest1 == 1 && crashtest2 == -1)  //too fast
                {
                    wall_angle = crashtest1_angle;
                }
            }
            // speed=-.3f*speed ;
            //  temp = new Vector3(car_position.X, car_position.Y, car_position.Z);
            // car_speed = car_speed/2;
            return(crash);
        }