Example #1
0
        public GameScreen(HostileSpace Game)
            : base(Game)
        {
            playerShip = new PlayerShip(Game);

            enemies.Add(new AI(Game, new SpaceShip(Game)));
        }
Example #2
0
        public CreditsScreen(HostileSpace Game)
            : base(Game)
        {
            background          = new RectangleShape(new Vector2f(576, 384));
            background.Position = new Vector2f(Game.Window.Size.X / 2, Game.Window.Size.Y / 2);
            background.Origin   = new Vector2f(background.Size.X / 2, background.Size.Y / 2);
            background.Texture  = Game.ContentManager.GetTexture("Bigbox");

            title          = new Text("Credits:", Game.ContentManager.GetFont("Arial"), 34);
            title.Position = new Vector2f((int)background.Position.X - 250, (int)background.Position.Y - 170);

            text               = new Text("", Game.ContentManager.GetFont("Arial"));
            text.Position      = new Vector2f((int)background.Position.X - 250, (int)background.Position.Y - 110);
            text.CharacterSize = 18;

            text.DisplayedString =
                "SFML - www.sfml-dev.org\n" +
                "#sfml for ideas and help\n" +
                "www.opengameart.org\n" +
                "\n" +
                "audio:\n" +
                "www.nosoapradio.us\n" +
                "Deceased Superior Technician\n" +
                "\n" +
                "graphics:\n" +
                "MillionthVector - www.millionthvector.blogspot.de\n" +
                "Daniel Cook - Lostgarden.com\n" +
                "";

            back = new Button(Game, "Back", (int)background.Position.X - 96, (int)background.Position.Y + 210);
        }
Example #3
0
 public MainScreen(HostileSpace Game)
     : base(Game)
 {
     newGameBTN  = new Button(Game, "Start Game", (int)(Game.Window.Size.X / 2) - 96, (int)Game.Window.Size.Y - 460);
     modulesBTN  = new Button(Game, "Ship Modules", (int)(Game.Window.Size.X / 2) - 96, (int)Game.Window.Size.Y - 380);
     settingsBTN = new Button(Game, "Settings", (int)(Game.Window.Size.X / 2) - 96, (int)Game.Window.Size.Y - 260);
     creditsBTN  = new Button(Game, "Credits", (int)(Game.Window.Size.X / 2) - 96, (int)Game.Window.Size.Y - 180);
     exitBTN     = new Button(Game, "Exit", (int)(Game.Window.Size.X / 2) - 96, (int)Game.Window.Size.Y - 100);
 }
Example #4
0
        public Button(HostileSpace Game, String Text, Int32 X, Int32 Y)
            : base(Game)
        {
            shape           = new RectangleShape(new Vector2f(192, 64));
            shape.Texture   = Game.ContentManager.GetTexture("Button02");
            shape.Position  = new Vector2f(X, Y);
            shape.FillColor = Color.White;

            text = new Text(Text, Game.ContentManager.GetFont("Arial"));
            text.CharacterSize = 24;
            text.Origin        = new Vector2f(text.GetGlobalBounds().Width / 2, 0);
            text.Position      = shape.Position + new Vector2f(shape.GetGlobalBounds().Width / 2, 18);
        }
Example #5
0
        public CheckBox(HostileSpace Game, Int32 X, Int32 Y)
            : base(Game)
        {
            shape           = new RectangleShape(new Vector2f(64, 64));
            shape.Texture   = Game.ContentManager.GetTexture("Checkbox");
            shape.Position  = new Vector2f(X, Y);
            shape.FillColor = Color.White;

            check = new Text("X", Game.ContentManager.GetFont("Arial"));
            check.CharacterSize = 34;
            check.Origin        = new Vector2f(check.GetGlobalBounds().Width / 2, 0);
            check.Position      = shape.Position + new Vector2f(shape.GetGlobalBounds().Width / 2, 10);
        }
Example #6
0
        public TwinkleStar(HostileSpace Game)
            : base(Game)
        {
            int tmp = rand.Next(0, 2);

            if (tmp == 0)
            {
                star = new Sprite(Game.ContentManager.GetTexture("BigStar01"));
            }
            else if (tmp == 1)
            {
                star = new Sprite(Game.ContentManager.GetTexture("BigStar02"));
            }

            star.Position = new Vector2f(100, 100);
            star.Origin   = new Vector2f(8, 8);
        }
Example #7
0
        public SettingsScreen(HostileSpace Game)
            : base(Game)
        {
            background          = new RectangleShape(new Vector2f(576, 384));
            background.Position = new Vector2f(Game.Window.Size.X / 2, Game.Window.Size.Y / 2);
            background.Origin   = new Vector2f(background.Size.X / 2, background.Size.Y / 2);
            background.Texture  = Game.ContentManager.GetTexture("Bigbox");

            title          = new Text("Settings (needs restart)", Game.ContentManager.GetFont("Arial"), 34);
            title.Position = new Vector2f((int)background.Position.X - 250, (int)background.Position.Y - 170);

            txt1024x768           = new Text("1024x786", Game.ContentManager.GetFont("Arial"), 24);
            txt1024x768.Position  = new Vector2f(background.Position.X - 180, background.Position.Y - 85);
            txt1280x720           = new Text("1280x720", Game.ContentManager.GetFont("Arial"), 24);
            txt1280x720.Position  = new Vector2f(background.Position.X + 70, background.Position.Y - 85);
            txt1920x1080          = new Text("1920x1080", Game.ContentManager.GetFont("Arial"), 24);
            txt1920x1080.Position = new Vector2f(background.Position.X - 180, background.Position.Y + 15);
            txt1920x1200          = new Text("1920x1200", Game.ContentManager.GetFont("Arial"), 24);
            txt1920x1200.Position = new Vector2f(background.Position.X + 70, background.Position.Y + 15);

            txtAudio          = new Text("Music", Game.ContentManager.GetFont("Arial"), 24);
            txtAudio.Position = new Vector2f(background.Position.X - 180, background.Position.Y + 115);
            txtSound          = new Text("Sound", Game.ContentManager.GetFont("Arial"), 24);
            txtSound.Position = new Vector2f(background.Position.X + 70, background.Position.Y + 115);

            chk1024x786  = new CheckBox(Game, (int)background.Position.X - 250, (int)background.Position.Y - 100);
            chk1280x720  = new CheckBox(Game, (int)background.Position.X, (int)background.Position.Y - 100);
            chk1920x1080 = new CheckBox(Game, (int)background.Position.X - 250, (int)background.Position.Y);
            chk1920x1200 = new CheckBox(Game, (int)background.Position.X, (int)background.Position.Y);

            audio         = new CheckBox(Game, (int)background.Position.X - 250, (int)background.Position.Y + 100);
            audio.Checked = Game.Settings.Audio;
            sound         = new CheckBox(Game, (int)background.Position.X, (int)background.Position.Y + 100);
            sound.Checked = Game.Settings.Sound;

            accept = new Button(Game, "Save", (int)background.Position.X - 220, (int)background.Position.Y + 210);
            back   = new Button(Game, "Back", (int)background.Position.X + 30, (int)background.Position.Y + 210);

            tmpX = Game.Settings.ResolutionX;
            tmpY = Game.Settings.ResolutionY;
        }
Example #8
0
 public Background(HostileSpace Game)
     : base(Game)
 {
     Generate();
 }
Example #9
0
 public FPSCounter(HostileSpace Game)
     : base(Game)
 {
 }
Example #10
0
        public ModuleSelector(HostileSpace Game)
            : base(Game)
        {
            background          = new RectangleShape(new Vector2f(576, 384));
            background.Position = new Vector2f(340, 100);
            background.Texture  = Game.ContentManager.GetTexture("Bigbox");

            for (int x = 0; x < 2; x++)
            {
                for (int y = 0; y < 7; y++)
                {
                    RectangleShape tmp = new RectangleShape(new Vector2f(30, 30));
                    tmp.FillColor        = Color.Transparent;
                    tmp.OutlineColor     = Color.White;
                    tmp.OutlineThickness = 1;
                    tmp.Position         = new Vector2f(370 + (x * 32), 182 + (y * 32));

                    grid.Add(tmp);
                }
            }

            for (int x = 0; x < 4; x++)
            {
                for (int y = 0; y < 6; y++)
                {
                    RectangleShape tmp = new RectangleShape(new Vector2f(30, 30));
                    tmp.FillColor        = Color.Transparent;
                    tmp.OutlineColor     = Color.White;
                    tmp.OutlineThickness = 1;
                    tmp.Position         = new Vector2f(570 + (x * 32), 182 + (y * 32));

                    grid.Add(tmp);
                }
            }


            title               = new Text("Module Selector:", Game.ContentManager.GetFont("Arial"));
            title.Position      = new Vector2f(360, 110);
            title.CharacterSize = 34;


            SmallLaser laser = new SmallLaser();

            selected = new Text("text", Game.ContentManager.GetFont("Arial"));
            selected.CharacterSize   = 14;
            selected.Position        = new Vector2f(450, 182);
            selected.DisplayedString = laser.Description;


            summary = new Text("", Game.ContentManager.GetFont("Arial"));
            summary.CharacterSize   = 14;
            summary.Position        = new Vector2f(750, 182);
            summary.DisplayedString =
                "Armor:\n" +
                "9999999\n" +
                "Shield:\n" +
                "9999999\n" +
                "Energy:\n" +
                "9999999\n" +
                "Shieldregen:\n" +
                "500\n" +
                "Energyregen:\n" +
                "500";
        }