public AnimationTransitionAlienMothership(double length, double visualPriority)
            : base(length, visualPriority)
        {
            In = false;

            MothershipBase = new Image("MothershipBase")
            {
                Blend = BlendType.Substract,
                SizeX = 12
            };

            MothershipTentacles = new Image("MothershipTentacles")
            {
                Blend = BlendType.Substract,
                SizeX = 12
            };

            MothershipLights = new Image("MothershipLights")
            {
                Blend = BlendType.Substract,
                SizeX = 12
            };

            PathIn = new Path2D(new List<Vector2>() { PositionIn.Key, PositionIn.Value }, new List<double>() { 0, Duration });
            PathOut = new Path2D(new List<Vector2>() { PositionOut.Key, PositionOut.Value }, new List<double>() { 0, Duration });
        }
Example #2
0
        public Help(Simulator simulator, List<string> texts)
        {
            Simulator = simulator;
            Texts = texts;

            Lieutenant = new Image("lieutenant", new Vector3(-500, 370, 0));
            Lieutenant.Origin = new Vector2(0, Lieutenant.TextureSize.Y);
            Lieutenant.SizeX = 5;
            Lieutenant.VisualPriority = VisualPriorities.Default.Tutorial;

            Bubble = new Image("bulle", new Vector3(-250, 200, 0));
            Bubble.Origin = new Vector2(0, Bubble.TextureSize.Y);
            Bubble.SizeX = 8;
            //Bubble.Color.A = 150;
            Bubble.VisualPriority = VisualPriorities.Default.Tutorial;

            ActiveText = 0;
            ActiveOverride = Texts.Count > 0;
            HiddingOverride = false;
            EffectTimeRemaining = 1000;

            InitDirective(Texts.Count == 0 ? "" : Texts[ActiveText]);

            Simulator.Scene.VisualEffects.Add(Lieutenant, Core.Visual.VisualEffects.FadeInFrom0(255, 0, EffectTimeRemaining));
            Simulator.Scene.VisualEffects.Add(Bubble, Core.Visual.VisualEffects.FadeInFrom0(150, 0, EffectTimeRemaining));
            Simulator.Scene.VisualEffects.Add(Directive.Text, Core.Visual.VisualEffects.FadeInFrom0(255, 0, EffectTimeRemaining));
        }
        public AnimationTransitionAsteroids(double length, double visualPriority)
            : base(length, visualPriority)
        {
            In = false;

            Asteroids = new List<Image>();
            PathsIn = new List<Path2D>();
            PathsOut = new List<Path2D>();
            RotationSpeeds = new List<float>();

            for (int i = 0; i < Positions.Count; i++)
            {
                var img = new Image(PossibleImages[Main.Random.Next(0, PossibleImages.Count)]);

                img.SizeX = 36;
                img.Blend = BlendType.Substract;

                Asteroids.Add(img);

                var posX = Main.Random.Next(900, 1500);

                PathsIn.Add(new Path2D(new List<Vector2>() { Positions[i], new Vector2(posX * 1.5f, Positions[i].Y) }, new List<double>() { 0, Duration }));
                PathsOut.Add(new Path2D(new List<Vector2>() { new Vector2(-posX, Positions[i].Y), Positions[i] }, new List<double>() { 0, Duration }));
                RotationSpeeds.Add(((float) (Main.Random.NextDouble() * 0.2)));
            }
        }
Example #4
0
        public WarningScene() :
            base("Warning")
        {
            ClearColor = Color.White;

            Continue = new Text(
                Preferences.Target == Core.Utilities.Setting.Xbox360 ?
                "Press a button to continue." :
                "Click a mouse button to continue.", "Pixelite", new Vector3(0, 270, 0))
                {
                    Color = new Color(255, 7, 106),
                    SizeX = 3
                }.CenterIt();

            Warning = new Text(Message, "Pixelite")
            {
                SizeX = 2,
                Color = Color.Black,
                VisualPriority = 0.5
            }.CenterIt();

            Background = new Image("WhiteBg", Vector3.Zero)
            {
                VisualPriority = 1,
                Color = new Color(Main.Random.Next(220, 255), Main.Random.Next(220, 255), Main.Random.Next(220, 255))
            };
        }
        public ChoicesHorizontalSlider(string label, List<string> choices, int startingIndex)
        {
            Choices = choices;
            ChoiceIndex = startingIndex;

            DecrementRep = new Image("WidgetNext") { Origin = Vector2.Zero, Effect = SpriteEffects.FlipHorizontally, SizeX = 4 };
            IncrementRep = new Image("WidgetNext") { Origin = Vector2.Zero, SizeX = 4 };

            ValueText = new Text(Choices[ChoiceIndex], @"Pixelite") { SizeX = 2 };
            Label = new Text(label, @"Pixelite") { SizeX = 2 };

            LongestChoice = new Text(@"Pixelite") { SizeX = 2 };

            foreach (var choice in Choices)
            {
                if (choice.Length > LongestChoice.Data.Length)
                    LongestChoice.Data = choice;
            }

            DecrementCircle = new Circle(Vector3.Zero, DecrementRep.AbsoluteSize.X / 2);
            IncrementCircle = new Circle(Vector3.Zero, IncrementRep.AbsoluteSize.X / 2);

            SpaceForLabel = 200;
            SpaceForValue = 200;
        }
 public UpgradeTurretContextualMenuChoice(string name, Text price, Text level, Image logo)
     : base(name)
 {
     Price = price;
     Level = level;
     Logo = logo;
 }
        public LogoTextContextualMenuChoice(string name, Text label, Image logo)
            : base(name)
        {
            Label = label;
            Logo = logo;

            DistanceBetweenNameAndLogo = new Vector2(Logo.AbsoluteSize.X + 10, 4);
            LogoOffet = Vector3.Zero;
        }
        public FinalSolutionPreview(Simulator simulator)
        {
            Simulator = simulator;

            BlowUpZoneVisual = new Image("CercleBlanc")
            {
                Color = new Color(255, 0, 0, 100),
                VisualPriority = Preferences.PrioriteGUIEtoiles - 0.002f
            };
        }
Example #9
0
 public void SetBackImage(string imageName, float size, Color color)
 {
     BackImage = new Image(imageName, position)
     {
         VisualPriority = VisualPriority + 0.00001,
         Color = color,
         SizeX = size
     };
     Size = BackImage.AbsoluteSize;
 }
Example #10
0
 public void SetFrontImage(string imageName, float size, Color color)
 {
     FrontImage = new Image(imageName, position)
     {
         VisualPriority = VisualPriority,
         Color = color,
         SizeX = size
     };
     Size = FrontImage.AbsoluteSize;
 }
Example #11
0
        public CheckBox(string label)
        {
            Label = new Text(label, @"Pixelite") { SizeX = 2 };

            Box = new Image("WidgetPush") { SizeX = 4, Origin = Vector2.Zero };
            CheckedRep = new Image("WidgetChecked") { SizeX = 4, Origin = Vector2.Zero };

            BoxCircle = new Circle(Vector3.Zero, Box.AbsoluteSize.X / 2);

            MinSpaceLabelX = 50;
        }
        public PowerUpsBattleship(Simulator simulator, double visualPriority)
        {
            Simulator = simulator;
            VisualPriority = visualPriority;

            Image = new Image("HumanBattleship")
            {
                VisualPriority = visualPriority,
                SizeX = 4
            };
        }
Example #13
0
        public CloseButton(Scene scene, Vector3 position, double visualPriority)
        {
            Button = new Image("WidgetClose")
            {
                SizeX = 4
            };

            VisualPriority = visualPriority;
            Position = position;

            ButtonCircle = new Circle(position, Button.AbsoluteSize.X / 2);
        }
Example #14
0
 public AlienSpaceship(double visualPriority)
 {
     Image = new Image("VaisseauAlien")
     {
         SizeX = 8,
         VisualPriority = visualPriority
     };
     
     Tentacules = Persistence.GetAssetCopy<Sprite>("tentacules");
     Tentacules.Taille = 8;
     Tentacules.Origine = Tentacules.Centre;
     Tentacules.VisualPriority = Image.VisualPriority + 0.01f;
 }
Example #15
0
        public HumanBattleship(Simulator simulator, string imageName, double visualPriority)
            : base(simulator, imageName)
        {
            Simulator = simulator;

            Image = new Image(imageName)
            {
                VisualPriority = visualPriority,
                SizeX = 4
            };

            Turrets = new List<Turret>();
        }
 public CelestialBodyShieldHitAnimation(Size size, Vector3 position, float rotation, Color color, double visualPriority)
     : base(300, visualPriority)
 {
     Shield = new Image(size == Size.Small ? "CBMask31" : size == Size.Normal ? "CBMask32" : "CBMask33", position)
     {
         SizeX = 6,
         Rotation = rotation,
         VisualPriority = visualPriority,
         Color = color,
         Alpha = 200,
         Blend = BlendType.Add
     };
 }
        public CommanderAnimation(Scene scene)
        {
            Scene = scene;

            Background = new Image("PixelBlanc")
            {
                Color = Color.White,
                Alpha = 0,
                Size = Preferences.BackBuffer,
                VisualPriority = VisualPriorities.Cutscenes.IntroCommanderBackground,
                Blend = BlendType.Add
            };

            Commander = new Text("Commander", @"Pixelite")
            {
                Color = Color.White,
                SizeX = 16,
                VisualPriority = VisualPriorities.Cutscenes.IntroCommanderText
            };

            SubTitle = new Translator(
                scene,
                new Vector3(0, 100, 0),
                "Alien", Colors.Default.NeutralDark,
                @"Pixelite", Colors.Default.AlienBright,
                "Todo: Subtitle here",
                5, true, 4000, 250, VisualPriorities.Cutscenes.IntroCommanderText, false);
            SubTitle.CenterText = true;

            TimeBeforeIn = IntroCutscene.Timing["CommanderIn"];

            PrepareLetters();

            //Scene.VisualEffects.Add(Background, Core.Visual.VisualEffects.FadeInFrom0(255, TimeBeforeIn, 2000));
            //Scene.VisualEffects.Add(Background, Core.Visual.VisualEffects.FadeOutTo0(255, TimeBeforeIn + 11000, 2000));

            foreach (var kvp in Letters)
            {
                kvp.Key.Alpha = 0;

                Scene.PhysicalEffects.Add(kvp.Key, Core.Physics.PhysicalEffects.Move(kvp.Value, TimeBeforeIn + 2000, 10000));
                Scene.VisualEffects.Add(kvp.Key, Core.Visual.VisualEffects.FadeInFrom0(255, TimeBeforeIn + Main.Random.Next(2000, 3000), 1500));
                Scene.VisualEffects.Add(kvp.Key, Core.Visual.VisualEffects.FadeOutTo0(255, TimeBeforeIn + 11000, 1000));
            }

            Scene.VisualEffects.Add(SubTitle, Core.Visual.VisualEffects.FadeInFrom0(255, TimeBeforeIn + 5000, 3000));
            Scene.VisualEffects.Add(SubTitle, Core.Visual.VisualEffects.FadeOutTo0(255, TimeBeforeIn + 11000, 1000));

            Elapsed = 0;
        }
        public SpaceshipAutomaticCollector(Simulator simulator)
            : base(simulator)
        {
            Image = new Image("Collecteur")
            {
                SizeX = 4
            };

            BuyPrice = 0;
            Active = true;
            SfxOut = "sfxAutomaticCollectorOut";
            SfxIn = "sfxAutomaticCollectorIn";
            Active = true;
        }
Example #19
0
        public Cursor(Scene scene, Vector3 initialPosition, float speed, double visualPriority, string imageName, bool visible)
        {
            Scene = scene;
            Speed = speed;
            VisualPriority = visualPriority;
            SetFrontImage(imageName, 1, new Color(255, 255, 255, 0));
            Shape = Shape.Circle;
            Circle = new Circle(initialPosition, Size.X / 4);
            Position = initialPosition;
            BackImage = null;
            MaxAlpha = 255;

            if (visible)
                FadeIn();
        }
Example #20
0
        public DisableBar(Scene scene)
        {
            Scene = scene;

            ProgressBarImage = new Image("PixelBlanc", Vector3.Zero)
            {
                Size = new Vector2(36, 4),
                Color = new Color(255, 0, 220, 255),
                Origin = new Vector2()
            };

            BarImage = new Image("BarreInactivite", Vector3.Zero)
            {
                SizeX = 3f
            };
        }
        public SpaceshipCollector(Simulator simulator)
            : base(simulator)
        {
            Image = new Image("Collecteur")
            {
                SizeX = 4
            };

            BuyPrice = 0;
            ShootingFrequency = double.NaN;
            Active = true;
            SfxOut = "sfxPowerUpCollecteurOut";
            SfxIn = "sfxPowerUpCollecteurIn";
            Active = true;
            ShowTrail = true;
        }
Example #22
0
        public SpaceshipMiner(Simulator simulator)
            : base(simulator)
        {
            Image = new Image("Resistance3")
            {
                SizeX = 4
            };

            BuyPrice = 0;
            Active = true;
            SfxOut = "sfxMinerOut";
            SfxIn = "sfxMinerIn";
            Active = true;
            ShowTrail = true;
            Weapon = new MineWeapon(Simulator, this);
        }
Example #23
0
        public GameMenu(Simulator simulator, Vector3 position)
        {
            Simulator = simulator;
            Position = position;

            Cash = 0;

            CashImage = new Image("ScoreMoney")
            {
                SizeX = 4,
                Alpha = 0,
                VisualPriority = Preferences.PrioriteGUIPanneauGeneral + 0.05,
                Position = Position,
                Origin = Vector2.Zero
            };

            CashText = new Text(@"Pixelite")
            {
                Alpha = 0,
                VisualPriority = Preferences.PrioriteGUIPanneauGeneral + 0.05,
                SizeX = 3,
                Position = CashImage.Position + new Vector3(CashImage.AbsoluteSize.X + 5, 0, 0)
            };


            LivesImage = new Image("ScoreLives")
            {
                SizeX = 4,
                Alpha = 0,
                VisualPriority = Preferences.PrioriteGUIPanneauGeneral + 0.05,
                Position = Position + new Vector3(0, CashImage.AbsoluteSize.Y, 0),
                Origin = Vector2.Zero
            };


            LivesText = new Text(@"Pixelite")
            {
                Alpha = 0,
                VisualPriority = Preferences.PrioriteGUIPanneauGeneral + 0.05,
                SizeX = 3,
                Position = LivesImage.Position + new Vector3(LivesImage.AbsoluteSize.X + 5, 0, 0)
            };


            Faded = true;
            FadeIn(255, 3000);
        }
Example #24
0
        public NextWaveMenu(
            Simulator simulator,
            Dictionary<EnemyType, EnemyDescriptor> ennemisQtes,
            Vector3 positionInitiale,
            float prioriteAffichage)
        {
            Simulator = simulator;
            EnnemisQtes = ennemisQtes;
            Position = positionInitiale;
            PrioriteAffichage = prioriteAffichage;

            RepresentationsEnnemis = new Dictionary<EnemyType, Image>();
            RepresentationsQtes = new Dictionary<EnemyType, Text>();
            RepresentationsNiveaux = new Dictionary<EnemyType, Text>();

            foreach (var kvp in EnemiesFactory.ImagesEnemies)
            {
                Image im = new Image(kvp.Value)
                {
                    VisualPriority = this.PrioriteAffichage + 0.00001f,
                    SizeX = 4
                };

                RepresentationsEnnemis.Add(kvp.Key, im);

                Text t = new Text(@"Pixelite")
                {
                    VisualPriority = this.PrioriteAffichage,
                    SizeX = 2
                };

                RepresentationsQtes.Add(kvp.Key, t);

                t = new Text(@"Pixelite")
                {
                    VisualPriority = this.PrioriteAffichage,
                    SizeX = 1
                };

                RepresentationsNiveaux.Add(kvp.Key, t);
            }

            Bubble = new Bubble(Simulator.Scene, new PhysicalRectangle(), this.PrioriteAffichage + 0.0001f);
            Bubble.BlaPosition = 1;

            Visible = false;
        }
        public WorldAnnunciationScene(WorldDescriptor descriptor) :
            base(Main.LevelsFactory.GetWorldAnnounciationStringId(descriptor.Id))
        {
            Descriptor = descriptor;

            WorldId = new Text(Main.LevelsFactory.GetWorldStringId(Descriptor.Id), @"Pixelite")
            {
                SizeX = 4,
                Color = Color.Black
            }.CenterIt();

            Background = new Image("WhiteBg", Vector3.Zero)
            {
                VisualPriority = 1,
                Alpha = 0
            };
        }
Example #26
0
        public Moon(Simulator simulator, CelestialBody celestialBody, int alpha, string imageName, int size)
        {
            Simulation = simulator;
            CelestialBody = celestialBody;

            Representation = new Image(imageName)
            {
                SizeX = size,
                VisualPriority = CelestialBody.VisualPriority + 0.000001f,
            };

            Representation.Alpha = (byte) alpha;

            Inversed = Main.Random.Next(0, 2) == 0;
            RotationTime = Main.Random.Next(3000, 10000);
            ActualRotationTime = Main.Random.Next(0, (int)RotationTime);
        }
        public PlayerLivesLiteral(Simulator simulator)
        {
            Simulator = simulator;

            LifeImage = new Image("ViesEnnemis5")
            {
                SizeX = 2,
                VisualPriority = VisualPriorities.Default.PlayerLives,
                Origin = Vector2.Zero
            };

            LifesCount = new Text(@"Pixelite")
            {
                SizeX = 2,
                VisualPriority = VisualPriorities.Default.PlayerLives
            };
        }
        public MineralTakenAnimation(Scene scene, MineralDefinition definition, Vector3 position, double visualPriority)
            : base(1000, visualPriority)
        {
            Value = new Image(definition.Texture, position);

            switch (definition.Type)
            {
                case MineralType.Cash150:
                    Value.SizeX = 2;
                    break;
                case MineralType.Life1:
                    Value.SizeX = 2;
                    break;
            }

            scene.VisualEffects.Add(Value, Core.Visual.VisualEffects.FadeOutTo0(255, 0, 1000));
            scene.PhysicalEffects.Add(Value, Core.Physics.PhysicalEffects.Move(position + new Vector3(0, -100, 0), 0, 1000));
        }
        public ShieldHitAnimation(string shieldName, Vector3 objPosition, Vector3 hitPosition, Color color, float sizeX, double visualPriority, float distFromSpaceship, byte alpha)
            : base(300, visualPriority)
        {
            Vector3 direction = hitPosition - objPosition;
            direction.Normalize();
            float rotation = Core.Physics.Utilities.VectorToAngle(direction);

            Vector3 position = hitPosition - direction * sizeX * 6;

            Shield = new Image(shieldName, position)
            {
                SizeX = sizeX,
                Rotation = rotation,
                VisualPriority = visualPriority,
                Color = color,
                Alpha = alpha,
                Blend = BlendType.Add
            };
        }
Example #30
0
        public void Initialize()
        {
            Id = Descriptor.Infos.Id;
            Mission = Descriptor.Infos.Mission;
            Difficulty = Descriptor.Infos.Difficulty;
            ParTime = Descriptor.ParTime;

            Background = new Image(Descriptor.Infos.Background, Vector3.Zero);
            Background.VisualPriority = Preferences.PrioriteFondEcran;

            InitializePlanetarySystem();
            InitializeTurrets();
            InitializeWaves();
            InitializeSpaceship();
            InitializeAvailableTurrets();
            InitializeAvailablePowerUps();

            for (int i = 0; i < PlanetarySystem.Count; i++)
                if (PlanetarySystem[i].PathPriority == Descriptor.Objective.CelestialBodyToProtect)
                {
                    CelestialBodyToProtect = PlanetarySystem[i];
                    break;
                }

            if (CelestialBodyToProtect != null)
                CelestialBodyToProtect.LifePoints = Descriptor.Player.Lives;

            CommonStash = new CommonStash()
            {
                Lives = Descriptor.Player.Lives,
                Cash = Descriptor.Player.Money,
                StartingPosition = Descriptor.Player.StartingPosition
            };

            Minerals = Descriptor.Minerals.Cash;
            LifePacks = Descriptor.Minerals.LifePacks;

            HelpTexts = Descriptor.HelpTexts;

            SaveBulletDamage = false;
        }