示例#1
0
 private PlayerWorld(TexturedPlane image, Color primaryColor, Color secondaryColor, string name, string description, int gate, string playerName, bool playerEntered, bool isVisible, float initAngle, float initDist, float initSpeed, float initHeight)
 {
     plane              = image;
     PrimaryColor       = primaryColor;
     SecondaryColor     = secondaryColor;
     Name               = name;
     Description        = description;
     gateLevel          = gate;
     PlayerName         = playerName;
     this.playerEntered = playerEntered;
     this.isVisible     = isVisible;
     if (initAngle != 0 || initSpeed != 0 || initHeight != 0 || initDist != 0)
     {
         UserPlaced            = true;
         initialDistFromCenter = initDist;
         initialAngle          = initAngle;
         initialOrbitalSpeed   = initSpeed;
         initialOrbitHeight    = initHeight;
         planeOrbit            = new OrbitModifier3D(new Vector3(0, initHeight, 0), Vector3.Up, initDist, initAngle, initSpeed, plane, false, -1);
         plane.AddModifier(planeOrbit);
     }
     else
     {
         UserPlaced = false;
     }
 }
示例#2
0
        public SessionLocation(string filePath, DynamicContentManager Content)
        {
            SessionLocationBuilder builder = SessionLocationBuilder.BuilderRead(filePath);

            plane              = new TexturedPlane(builder.Image);
            plane.billboard    = true;
            isVisible          = builder.IsVisible;
            PrimaryColor       = new Color((byte)builder.PrimaryColor.X, (byte)builder.PrimaryColor.Y, (byte)builder.PrimaryColor.Z, (byte)builder.PrimaryColor.W);
            Name               = builder.Name;
            Description        = builder.Description;
            CursorDetectRadius = builder.CursorDetectRadius;
            if (builder.InitialAngle != 0 || builder.OrbitalSpeed != 0 || builder.OrbitHeight != 0 || builder.DistFromCenter != 0)
            {
                UserPlaced            = true;
                initialDistFromCenter = builder.DistFromCenter;
                initialAngle          = builder.InitialAngle;
                initialOrbitalSpeed   = builder.OrbitalSpeed;
                initialOrbitHeight    = builder.OrbitHeight;
                plane.AddModifier(new OrbitModifier3D(new Vector3(0, builder.OrbitHeight, 0), Vector3.Up, builder.DistFromCenter, builder.InitialAngle, builder.OrbitalSpeed, plane, false, -1));
            }
            else
            {
                UserPlaced = false;
            }
        }
示例#3
0
        private void constructSkaia()
        {
            godTierInnerSpiro = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(45), new Color(182, 251, 255, 100),
                                                  true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 1.png"));
            godTierInnerSpiro.depthBias = -0.02f;
            godTierInnerSpiro.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1));
            godTierInnerFill = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(45), new Color(0, 197, 255, 66),
                                                 true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 2.png"));
            godTierInnerFill.depthBias = -0.01f;
            godTierInnerFill.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1));
            godTierOuterSpiro = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(67), new Color(182, 251, 255, 66),
                                                  true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 1.png"));
            godTierOuterSpiro.depthBias = -0.04f;
            godTierOuterSpiro.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1));
            godTierOuterFill = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(67), new Color(0, 197, 255, 66),
                                                 true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 2.png"));
            godTierOuterFill.depthBias = -0.03f;
            godTierOuterFill.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1));
            glowEffect = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(40), new Color(0, 197, 255, 128),
                                           true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//Glow.png"));
            glowEffect.depthBias = -0.05f;
            godTierSymbol        = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(7), new Color(0, 0, 0, 255),
                                                     true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//of Breath.png"));
            godTierSymbol.depthBias = -0.06f;

            lowerSpirograph               = new Spirograph(1f, 10f / 7f, 7, 1, 12, 0, Color.White);
            lowerSpirograph.Rotation      = Quaternion.CreateFromYawPitchRoll(0, 0, MathHelper.PiOver2);
            lowerSpirograph.WorldPosition = new Vector3(0, 2, 0);
            lowerSpirograph.AddModifier(new RotateModifier3D(Quaternion.CreateFromYawPitchRoll(-0.01f, 0, 0), false, -1));
            lowerSpirograph.Generate(600);

            reckoningGates = new Spirograph[50];
        }
示例#4
0
        public GenericMeteor(string filePath, DynamicContentManager Content)
        {
            GenericMeteorBuilder meteorData = GenericMeteorBuilder.BuilderRead(filePath);

            plane           = new TexturedPlane(meteorData.Image);
            plane.billboard = true;
            name            = meteorData.Name;
        }
示例#5
0
        private Skaia(Skaia skaiaData)
        {
            plane              = skaiaData.plane.DeepCopy();
            Battlefield        = skaiaData.Battlefield.DeepCopy();
            PrimaryColor       = skaiaData.PrimaryColor;
            Name               = skaiaData.Name;
            Description        = skaiaData.Description;
            isVisible          = skaiaData.IsVisible;
            CursorDetectRadius = skaiaData.CursorDetectRadius;

            constructSkaia();
        }
示例#6
0
        public Skaia(string filePath, DynamicContentManager Content)
        {
            SkaiaBuilder builder = SkaiaBuilder.BuilderRead(filePath);

            plane                 = new TexturedPlane(builder.Image);
            Battlefield           = new TexturedPlane(builder.Battlefield);
            Battlefield.DepthBias = -0.01f;
            plane.billboard       = true;
            Battlefield.billboard = true;
            CursorDetectRadius    = builder.CursorDetectRadius;
            PrimaryColor          = new Color((byte)builder.PrimaryColor.X, (byte)builder.PrimaryColor.Y, (byte)builder.PrimaryColor.Z, (byte)builder.PrimaryColor.W);
            Name        = builder.Name;
            Description = builder.Description;
            isVisible   = builder.IsVisible;

            constructSkaia();
            //for (int i = 0; i < 50; i++)
            //{
            //    reckoningGates[i] = new
            //}
        }
示例#7
0
        private void reload(string filePath, DynamicContentManager Content)
        {
            SessionLocation newState = Content.Load <SessionLocation>(filePath);

            newState.plane.ClearModifiers();
            TexturedPlane oldPlane = plane;

            plane               = newState.plane;
            plane.Color         = oldPlane.Color;
            plane.WorldPosition = oldPlane.WorldPosition;
            IsVisible           = newState.isVisible;
            PrimaryColor        = newState.PrimaryColor;
            Name               = newState.Name;
            Description        = newState.Description;
            CursorDetectRadius = newState.CursorDetectRadius;
            for (int i = 0; i < oldPlane.Modifiers.Length; i++)
            {
                if (oldPlane.Modifiers[i] != null)
                {
                    plane.AddModifier(oldPlane.Modifiers[i].DeepCopy(plane));
                }
            }
        }
示例#8
0
        public override void LoadContent()
        {
            base.LoadContent();

            cursor = new TexturedPlane(Vector3.Zero, Quaternion.Identity, new Vector2(7), Color.White, false,
                                       ScreenManager.Content.Load <Texture2D>(".//UI//Cursor.png"));

            currentSession = ScreenManager.Content.Load <SessionManager>(sessionPath);
            float innerRimSize = 90;

            innerRim = new TexturedPlane(new Vector3(0, 5, 0), Quaternion.Identity, new Vector2(innerRimSize), Color.White,
                                         false, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//Inner Rim.png"));
            float outerRimSize = currentSession.PlayerWorldCount * 25 + innerRimSize;

            outerRim = new TexturedPlane(new Vector3(0, 5, 0), Quaternion.Identity, new Vector2(outerRimSize), Color.White,
                                         false, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//Outer Rim.png"));

            ScreenManager.Globals.Camera = new SphericalCamera(new Vector3(0, 4, 0), new Vector2(0, 60), 125);
            (ScreenManager.Globals.Camera as SphericalCamera).MaxZoomLevel = 600;
            cameraRange = (outerRimSize / 2) + 45f;

            descriptionControl          = new Button(new AABox(new Rectangle(0, 0, 136, 23)), position: new Coordinate(0, 578));
            descriptionBox              = new Button(null, ScreenManager.Content.Load <Texture2D>(".//UI//Description Box.png"), null, new Coordinate(0, 574));
            descriptionText             = new TextBox("", new Rectangle(5, 605, 790, 186), "Default");
            descriptionControl.Clicked += OnOpenDescription;

            float  outerRimCircumference = (float)(outerRimSize * Math.PI);
            Random rand = new Random(4);

            if (outerRimCircumference < 1000)
            {
                genericMeteors = new GenericMeteor[(int)outerRimCircumference];
            }
            else
            {
                genericMeteors = new GenericMeteor[1000];
            }
            for (int i = 0; i < genericMeteors.Length; i++)
            {
                float angleOffset = (float)(rand.NextDouble() - 0.5);
                float distOffset  = (float)(rand.NextDouble() - 0.5) * 10f;
                float yOffset     = (float)(rand.NextDouble() - 0.5) * 3f;
                genericMeteors[i] = currentSession.GenericMeteors[rand.Next(currentSession.GenericMeteors.Length)].DeepCopy();
                genericMeteors[i].AddModifier(new OrbitModifier3D(new Vector3(0, 8 + yOffset, 0), Vector3.Up,
                                                                  (outerRimSize / 2) + 7.5f + distOffset, (float)((Math.PI * 2) * ((float)i / genericMeteors.Length)) + angleOffset,
                                                                  -0.002f, genericMeteors[i], false, -1));
            }
            //foreach (var keyValue in currentSession.Worlds)
            //    keyValue.Value.Initialize();
            if (currentSession.Worlds["Prospit"].UserPlaced == false)
            {
                currentSession.Worlds["Prospit"].WorldPlane.AddModifier(new OrbitModifier3D(new Vector3(0, 12, 0),
                                                                                            Vector3.Up, 15, 0, -0.002f, currentSession.Worlds["Prospit"].WorldPlane, false, -1));
            }
            if (currentSession.Worlds["Derse"].UserPlaced == false)
            {
                currentSession.Worlds["Derse"].WorldPlane.AddModifier(new OrbitModifier3D(new Vector3(0, 12, 0),
                                                                                          Vector3.Up, outerRimSize / 2 + 15, 1, 0.002f, currentSession.Worlds["Derse"].WorldPlane, false, -1));
            }
            //Prospit: new Vector3(0, 12, 0), Vector3.Up, 15, 0, -0.002f  Derse: new Vector3(0, 12, 0), Vector3.Up, outerRimSize / 2 + 15, 1, 0.002f
            int   h          = 0;
            float planetDist = (outerRimSize / 2 - innerRimSize / 2) / 2 + innerRimSize / 2;

            foreach (var keyValue in currentSession.Worlds)
            {
                if (keyValue.Value is PlayerWorld)
                {
                    PlayerWorld world = keyValue.Value as PlayerWorld;
                    world.Initialize(planetDist, (MathHelper.TwoPi / currentSession.PlayerWorldCount) * h, 0.003f);
                    h++;
                }
            }
            //timelineControl = new TimelineControl(currentSession, this);
            alphaTester = new AlphaTestEffect(ScreenManager.Globals.Graphics);
        }
示例#9
0
 public GenericMeteor(TexturedPlane image, string Name)
 {
     plane = image;
     name  = Name;
 }
示例#10
0
        private void reload(string filePath, DynamicContentManager Content)
        {
            PlayerWorld   newState = Content.Load <PlayerWorld>(filePath);
            TexturedPlane oldPlane = plane;

            plane               = newState.plane;
            plane.Color         = oldPlane.Color;
            plane.WorldPosition = oldPlane.WorldPosition;
            //planeOrbit = (OrbitModifier3D)planeOrbit.DeepCopy(plane);
            //plane.AddModifier(planeOrbit);
            IsVisible      = newState.isVisible;
            PrimaryColor   = newState.PrimaryColor;
            SecondaryColor = newState.SecondaryColor;
            Name           = newState.Name;
            Description    = newState.Description;
            PlayerName     = newState.PlayerName;
            if (newState.CursorDetectRadius > 0)
            {
                CursorDetectRadius = newState.CursorDetectRadius;
            }

            if (gateLevel != newState.gateLevel && PlayerEntered)
            {
                setGates(gateLevel);
            }
            gateLevel = newState.gateLevel;

            for (int i = 0; i < oldPlane.Modifiers.Length; i++)
            {
                if (oldPlane.Modifiers[i] != null)
                {
                    IModifier3D newMod = oldPlane.Modifiers[i].DeepCopy(plane);
                    if (oldPlane.Modifiers[i] == planeOrbit)
                    {
                        planeOrbit = (OrbitModifier3D)newMod;
                    }
                    plane.AddModifier(newMod);
                }
            }

            if (PlayerEntered != newState.PlayerEntered)
            {
                PlayerEntered = newState.PlayerEntered;
                for (int i = 0; i < lowerSpirograph.Modifiers.Length; i++)
                {
                    if (lowerSpirograph.Modifiers[i] != null && lowerSpirograph.Modifiers[i] is ColorModifier3D)
                    {
                        lowerSpirograph.Modifiers[i].Remove();
                        i--;
                    }
                }
                for (int i = 0; i < plane.Modifiers.Length; i++)
                {
                    if (plane.Modifiers[i] != null && plane.Modifiers[i] is ColorModifier3D)
                    {
                        plane.Modifiers[i].Remove();
                        i--;
                    }
                }
                if (PlayerEntered)
                {
                    lowerSpirograph.AddModifier(new ColorModifier3D(PrimaryColor, true, lowerSpirograph, 90));
                    plane.AddModifier(new ColorModifier3D(Color.White, true, plane, 90));
                    setGates(gateLevel);
                }
                else
                {
                    lowerSpirograph.AddModifier(new ColorModifier3D(Color.Lerp(PrimaryColor, Color.Black, 0.8f), true, lowerSpirograph, 90));
                    plane.AddModifier(new ColorModifier3D(new Color(50, 50, 50), true, plane, 90));
                    setGates(0);
                }
            }
            //else if (!PlayerEntered)
            //    setGates(0);
        }