Пример #1
0
        /// <summary>
        /// Load happens once when the scene is created
        /// </summary>
        public override void Load()
        {
            // Background
            Background.AddLayer("TitleSceneBackground");
            Background.ScaleToScreen();

            // Text
            LoadFont("INATitle");
            Text titleText = new Text
            {
                Value =@"Insecticon
               Attack",
                VerticalAlign = VerticalAlignments.Top,
                Alignment = HorizontalAlignments.Center,
                Scale = 10,
                X = 0,
                Y = 90, Color= Color.LimeGreen
            };
            AddText(titleText);  // Adds the title text object to the scene, so that it will be drawn

            AddSong("BackgroundMusic1");
            PlaySong("BackgroundMusic1", true);

            // Sprites
            startButton = new PauseButton();
            AddSprite(startButton);
        }
Пример #2
0
        /// <summary>
        /// Load the achievment screen
        /// </summary>
        public override void Load()
        {
            BackgroundColor = Color.Black;
            FontName = "QuartzMS";

            // Add the sprites
            AchievmentTypes a = AchievmentTypes.FirstHit;
            foreach (AchievmentTypes type in a.GetAllValues())
            {
                bool Earned;
                Earned = PlayerData.GetBool(type.ToString(), false);
                AchievmentsEarned.Add(type, Earned);
                AchievmentSprites.Add(type, AddSprite<AchievmentThingSprite>());
                AchievmentSprites[type].SetAchievmentType(type);
            }

            // Add the "Achievments" text
            AchievmentScreenText = AddText(new Text
            {
                Value = "Achievments",
                Position = new Vector2(0f, 70f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Center,
                Scale = 0.5f,
                Color = Color.Lime
            });
        }
Пример #3
0
        /// <summary>
        /// Load the game over screen
        /// </summary>
        public override void Load()
        {
            GridStyle = GridStyles.Ticks;
            BackgroundColor = Color.Black;
            FontName = "QuartzMS";

            // Add the score text
            ScoreText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale = .4f,
                Position = new Vector2(-100f, 100f),
                Color = Color.White
            });

            // Add the start key text
            RestartText = AddText(new Text
            {
                Value = "Press SPACE to Play",
                Position = new Vector2(0f, -100f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Bottom,
                AnimationType = TextAnimations.Typewriter,
                AnimationSeconds = 0.2,
                Scale = 0.5f,
                Color = Color.Lime
            });
            if (Game.Platform == GamePlatforms.XBox)
            {
                RestartText.Value = "Press START to Play";
            }
            else if (Game.Platform == GamePlatforms.WindowsPhone)
            {
                RestartText.Value = "TAP to Play";
            }

            missile = AddSprite<MissileSprite>();
            missile.SetCostume("ufo");
            missile.Costume.YCenter = VerticalAlignments.Center;
            missile.Scale = 2;
            missile.Show();
            missile.X = 0;
            missile.Y = 50;

            barrier = AddSprite<BarrierSprite>();
            barrier.Scale = 2.5f;
            barrier.Y = -70;

            ufo = AddSprite<UfoSprite>();
            ufo.Position = Vector2.Zero;
            ufo.Costume.YCenter = VerticalAlignments.Top;
            ufo.Scale = 1;
            ufo.Show();
        }
Пример #4
0
using Color = Microsoft.Xna.Framework.Color;
#endregion
namespace ScratchyXna
{
    public class PlayScreen : Scene
    {
        public enum PlayScreenModes
        {
            Init,
            ShowingPlayerNumber,
            Playing,
            Finished
        }
        /// <summary>
        /// Load the game over screen
        /// </summary>
        public override void Load()
        {
            // GridStyle = GridStyles.Ticks;
            BackgroundColor = Color.Black;
            FontName = "QuartzMS";

            // Add the score text
            ScoreText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale = .4f,
                Position = new Vector2(-100f, 100f),
                Color = Color.White
            });

            // Add the start key text
            RestartText = AddText(new Text
            {
                Value = "Press SPACE to Play Again",
                Position = new Vector2(0f, -100f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Bottom,
                AnimationType = TextAnimations.Typewriter,
                AnimationSeconds = 0.2,
                Scale = 0.5f,
                Color = Color.Lime
            });
            if (Game.Platform == GamePlatforms.XBox)
            {
                RestartText.Value = "Press START to Play Again";
            }
            else if (Game.Platform == GamePlatforms.WindowsPhone)
            {
                RestartText.Value = "TAP to Play Again";
            }

            AddSound("happyhappy");
            hypnodisc = AddSprite<Hypnodisc>();
            mugatu = AddSprite<Mugatu>();
            HappyText = AddText(new Text {
                Value = "HAPPY",
                Color = Color.OrangeRed,
                Scale = 3,
                Position = new Vector2(0, 90),
                Alignment = HorizontalAlignments.Center });
        }
Пример #6
0
        /// <summary>
        /// Load the title screen
        /// </summary>
        public override void Load()
        {
            BackgroundColor = Color.Black;
            FontName = "QuartzMS";
            TitleMole = AddSprite<TitleMoleSprite>();
            TitleMole.Y = -105;

            //Add the texts
            StartText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Center,
                Scale = .4f,
                Position = new Vector2(0, 80),
                Color = Color.White,
                AnimationType = TextAnimations.Throb,
                AnimationSeconds = 0.5,
                AnimationIntensity = 0.5,
                Value = "Whack a Jerk"
            });
        }
Пример #7
0
        /// <summary>
        /// Start the play screen
        /// This happens at the beginning of the game, and when you're done playing
        /// </summary>
        public override void StartScene()
        {
            Texts.Clear();
            Sprites.Clear();
            AddSprite(new FloorSprite());
            AddSprite(new BlockerSprite());
            AddSprite(new JammerSprite());
            AddSprite(new PivotSprite());
            AddSprite(new RefSprite());

            // Add the text
            ScoreText = AddText(new Text
            {
                Position = new Vector2(-160f, 120f),
                Alignment = HorizontalAlignments.Left,
                AnimationType = TextAnimations.None,
                AnimationSeconds = 0.15,
                Scale = 2f
            });
            ScoreText.GlideTo(-160f, 95f, 1);
        }
Пример #8
0
        /// <summary>
        /// Start the title screen
        /// This happens at the beginning of the game, and when you're done playing
        /// </summary>
        public override void StartScene()
        {
            Texts.Clear();
            Sprites.Clear();
            AddSprite(new FloorSprite());
            Girl1 = new TitleScreenGirl1Sprite { Scale = GirlScale, Y = GirlBottom };
            Girl2 = new TitleScreenGirl2Sprite { Scale = GirlScale, Y = GirlBottom };
            AddSprite(Girl1);
            AddSprite(Girl2);

            HighScoreText = AddText(new Text
            {
                Value = "High Score:",
                Position = new Vector2(0f, 0f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Center,
                AnimationType = TextAnimations.None,
                AnimationSeconds = 0.2,
                AnimationIntensity = 0.05,
                Scale = 3f,
            });

            HighScore = PlayerData.GetInt("HighScore", 0);
            HighScoreText.Value = "High Score: " + HighScore;

            // Add the title text
            TitleText = AddText(new Text
            {
                Value = "Scratchy Derby",
                Position = new Vector2(0f, 140f),
                Alignment = HorizontalAlignments.Center,
                Scale = 7f
            });

            // Add the start key text
            StartText = AddText(new Text
            {
                Value = "Press SPACE to Play",
                Position = new Vector2(0f, -90f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Bottom,
                AnimationType = TextAnimations.Throb,
                AnimationSeconds = 0.2,
                AnimationIntensity = 0.1f,
                Scale = 5f,
                Color = Color.Lime
            });

            if (Game.Platform == GamePlatforms.XBox)
            {
                StartText.Value = "Press START to Play";
            }
            else if (Game.Platform == GamePlatforms.WindowsPhone)
            {
                StartText.Value = "TAP to Play";
            }
            Girl1.GlideIn(0.9f);
            Girl2.GlideIn(0.7f);

            Wait (0.8, StartGlideTitle);
        }
        /// <summary>
        /// Load the game over screen
        /// </summary>
        public override void Load()
        {
            BackgroundColor = Color.Black;
            FontName = "QuartzMS";

            // Add the game over text
            GameOverText = new Text
            {
                Value = "Game Over",
                Color = Color.Red,
                Alignment = HorizontalAlignments.Center,
                AnimationType = TextAnimations.Throb,
                AnimationSeconds = 0.5,
                AnimationIntensity = 0.5
            };
            AddText(GameOverText);

            // Add the high score text
            HighScoreText = AddText(new Text
            {
                Value = "High Score:",
                Position = new Vector2(80f, 90f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Top,
                AnimationType = TextAnimations.SeeSaw,
                AnimationSeconds = 0.2,
                AnimationIntensity = 0.15,
                Scale = 0.4f,
            });

            // Add the score text
            ScoreText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale = .4f,
                Position = new Vector2(-100f, 100f),
                Color = Color.White
            });

            // Add the start key text
            RestartText = AddText(new Text
            {
                Value = "Press SPACE to Play Again",
                Position = new Vector2(0f, -100f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Bottom,
                AnimationType = TextAnimations.Typewriter,
                AnimationSeconds = 0.2,
                Scale = 0.5f,
                Color = Color.Lime
            });
            if (Game.Platform == GamePlatforms.XBox)
            {
                RestartText.Value = "Press START to Play Again";
            }
            else if (Game.Platform == GamePlatforms.WindowsPhone)
            {
                RestartText.Value = "TAP to Play Again";
            }
        }
Пример #10
0
        /// <summary>
        /// Load the screen
        /// </summary>
        public override void Load()
        {
            BackgroundColor = Color.Black;
            FontName = "QuartzMS";

            //Add the sounds
            AddSound("hit");

            // Create the sprites
            building = AddSprite<BuildingSprite>();
            levelsprite = AddSprite<LevelSprite>();
            achievmentthing = AddSprite<AchievmentThingSprite>();
            //hammer = AddSprite<HammerSprite>();

            //Create the texts
            ScoreText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Right,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale = .4f,
                Position = new Vector2(60f, -100f),
                Color = Color.White
            });

            MoneyText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale = .4f,
                Position = new Vector2(-60, -100f),
                Color = Color.White
            });

            LevelText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale = .4f,
                Position = new Vector2(-60, 100),
                Color = Color.White
            });
        }
Пример #11
0
        /// <summary>
        /// Load the play screen
        /// </summary>
        public override void Load()
        {
            BackgroundColor = Color.SkyBlue;
            DesertBackground desertBackground = new DesertBackground(this);
            GroundLayer = desertBackground.GroundLayer;
            Background = desertBackground;
            AddSong("Chopliftertheme");
            FontName = "DirtyEgo";

            // Add the saved text
            SavedText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale = 1f,
                Position = new Vector2(-160f, 100f),
                Color = Color.White
            });

            // Add the score text
            ScoreText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale = 0.8f,
                Position = new Vector2(140, -100),
                Color = Color.White
            });

            // Add the level text
            LevelText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale = 0.8f,
                Position = new Vector2(-160f, -100f),
                Color = Color.White
            });

            // Add the in text
            InText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Top,
                Scale = 1f,
                Position = new Vector2(0f, 100f),
                Color = Color.White
            });

            // Add the dead text
            DeadText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Right,
                VerticalAlign = VerticalAlignments.Top,
                Scale = 1f,
                Position = new Vector2(160f, 100f),
                Color = Color.White
            });

            // Add the lives text
            LivesText = AddText(new Text
            {
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale = 0.8f,
                Position = new Vector2(0f, -100f),
                Color = Color.White
            });

            // Load Costumes
            Explosion explosion = new Explosion();
            explosion.Load();
        }
Пример #12
0
        /// <summary>
        /// Start the title screen
        /// This happens at the beginning of the game, and when you're done playing
        /// </summary>
        public override void StartScene()
        {
            Texts.Clear();
            Sprites.Clear();

            // Add the title text
            AddText(new Text
            {
                Value = "Space Invaders",
                Position = new Vector2(0f, 80f),
                Alignment = HorizontalAlignments.Center,
                AnimationType = TextAnimations.Typewriter,
                AnimationSeconds = 0.15,
                Scale = 1f,
                //Font = FancyFont,
                OnAnimationComplete = (Text text) =>
                {
                    // When the title text is done typing, show the high score
                    HighScoreText = AddText(new Text
                    {
                        Value = "High Score:",
                        Position = new Vector2(80f, 90f),
                        Alignment = HorizontalAlignments.Center,
                        VerticalAlign = VerticalAlignments.Top,
                        AnimationType = TextAnimations.SeeSaw,
                        AnimationSeconds = 0.2,
                        AnimationIntensity = 0.15,
                        Scale = 0.4f,
                    });

                    UfoSprite ufo = AddSprite<UfoSprite>();
                    ufo.X = -49;
                    ufo.Y = 45;

                    Wait(2.3f, () =>
                    {
                        AlienSprite alien = AddSprite<AlienSprite>();
                        alien.X = -40;
                        alien.Y = 13;
                        alien.Setup(1);
                    });
                    Wait(5.2f, () =>
                    {
                        AlienSprite alien = AddSprite<AlienSprite>();
                        alien.X = -40;
                        alien.Y = -13;
                        alien.Setup(2);
                    });
                    Wait(8.7, () =>
                    {
                        AlienSprite alien = AddSprite<AlienSprite>();
                        alien.X = -40;
                        alien.Y = -43;
                        alien.Setup(3);
                    });

                    AlienScoreText = AddText(new Text
                    {
                        Value = "= ? POINTS" + Text.NewLine + Text.NewLine +
                        "= 10 POINTS" + Text.NewLine + Text.NewLine +
                        "= 20 POINTS" + Text.NewLine + Text.NewLine +
                        "= 30 POINTS",
                        Position = new Vector2(0, 0),
                        Alignment = HorizontalAlignments.Center,
                        VerticalAlign = VerticalAlignments.Center,
                        AnimationType = TextAnimations.Typewriter,
                        AnimationSeconds = 0.2,
                        Scale = 0.8f,
                        Color = Color.White
                    });

                }
            });

            // Add the 1p start key text
            Player1StartText = AddText(new Text
            {
                Value = "1 Player Start",
                Position = new Vector2(-65f, -85f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Center,
                AnimationType = TextAnimations.None,
                AnimationIntensity = 0.2,
                Scale = 0.6f,
                Color = Color.Lime
            });

            // Add the 2p start key text
            Player2StartText = AddText(new Text
            {
                Value = "2 Player Start",
                Position = new Vector2(65f, -85f),
                Alignment = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Center,
                AnimationType = TextAnimations.None,
                AnimationIntensity = 0.2,
                Scale = 0.6f,
                Color = Color.Lime
            });

            if (SpaceInvaders.NumberOfPlayers == 1)
            {
                Player1StartText.AnimationType = TextAnimations.Throb;
                Player1StartText.Scale = 0.6f;
                Player1StartText.Start();
            }
            else
            {
                Player2StartText.AnimationType = TextAnimations.Throb;
                Player2StartText.Scale = 0.6f;
                Player2StartText.Start();
            }
        }