Ejemplo n.º 1
0
        public Tutorial(Game1 game)
        { 
            _game = game;

            //Game1.BackgroundImage = AssetManager.Textures[Enums.Assets.STORY_BACKGROUND];

            _textbox = new Objects.GameObject(_game, new Vector2(500, 420))
            {
                Texture = AssetManager.Textures[Assets.STORY_TEXTBOX]
            };

            _ship = new ShipObject(game, new Vector2(50, 250));
            _ship.EnterMap();
            _ship.Cannon.UpdateCannon = false;
             
            _font = AssetManager.Fonts[Enums.Assets.FONT];

            _tutorial = new List<Texture2D>
            {
                AssetManager.Textures[Enums.Assets.TUTORIAL_STEP1],
                AssetManager.Textures[Enums.Assets.TUTORIAL_STEP2],
                AssetManager.Textures[Enums.Assets.TUTORIAL_STEP3]
            };

        } 
Ejemplo n.º 2
0
        public Highscore(Game1 game)
        {
            _game = game;
            _scoreboard = new Objects.GameObject(_game, new Vector2(300, 20))
            {
                Texture = AssetManager.Textures[Assets.HIGHSCORE_BACKGROUND]
            };

            _font = AssetManager.Fonts[Enums.Assets.FONT];

            _pointer = new Objects.GameObject(_game, new Vector2(930, 150))
            {
                Texture = AssetManager.Textures[Assets.MENU_POINTER],
                SpriteEffect = SpriteEffects.FlipHorizontally
            };

            _scoreLocations = new List<Vector2>()
            {
                new Vector2(450, 270),
                new Vector2(450, 385),
                new Vector2(450, 510)
            };
            LoadHighscore();

        }
Ejemplo n.º 3
0
        public Story(Game1 game)
        { 
            _game = game;

            //Game1.BackgroundImage = AssetManager.Textures[Enums.Assets.STORY_BACKGROUND];

            _textbox = new Objects.GameObject(_game, new Vector2(500, 420))
            {
                Texture = AssetManager.Textures[Assets.STORY_TEXTBOX]
            };

            _ship = new ShipObject(game, new Vector2(50, 250));
            _ship.EnterMap();
            _ship.Cannon.UpdateCannon = false;
             
            _font = AssetManager.Fonts[Enums.Assets.FONT];

            _text = new List<string>
            {
                "Ahoi maatje! Mijn naam is Kapitein Kat, \nen ik heb jouw hulp nodig! Heel lang geleden \nheeft Opa Kat een schat gevonden \nen ergens verstopt.",
                "Maar nu is ie vergeten waar hij de schat \nheeft begraven! Hij heeft een paar reken-\nsommetjes achtergelaten als aanwijzing, maar ik \nben niet zo goed in rekenen! Kan jij mij helpen?",
                "Zou ik je naam mogen weten?\nVoer je naam in: %name"
            };

        } 
Ejemplo n.º 4
0
 public Topbar(Game1 game, Vector2 location, Player player, string question, Texture2D questionTexture) 
     : base (game,location)
 {
     _font = AssetManager.Fonts[Enums.Assets.FONT];
     _player = player;
     _question = question;
     _questionBar = new GameObject(game, new Vector2(location.X + 100, Location.Y + 60))
     {
         Texture = questionTexture
     };
 }
Ejemplo n.º 5
0
        public Control(Game game)
        {
            _aimed = true;
            _rotateCannon = true;
            _cannon = new CannonObject(game, new Vector2(350, 465));

            _bullet = new GameObject(game, new Vector2(0, 0))
            {
                Texture = AssetManager.Textures[Enums.Assets.GAME_BULLET]
            };
            _bullet.Location = new Vector2((_cannon.Location.X + _cannon.Texture.Width) - _bullet.Texture.Width, _cannon.Location.Y - 18);

            _cannonRotationSpeed = 0.02f;
            _bulletMoveSpeed = new Vector2(0,0);
        }
Ejemplo n.º 6
0
        public ShipObject(Game1 game, Vector2 location) 
            : base (game,location)
        {
            Texture = AssetManager.Textures[Enums.Assets.GAME_SHIP];

            _cannon = new CannonObject(game, new Vector2(350, 465));

            _captainCat = new GameObject(game, location + new Vector2(210, 150)) { 
                Texture = AssetManager.Textures[Enums.Assets.GAME_CHARACTER]
            };
            _moveSpeed = new Vector2(10, 0);


            _captainCat.Location.X = -90;
            _cannon.Location.X = 0;
            Location.X = -300;
            _enterMap = true;
        }
Ejemplo n.º 7
0
        public StartScreen(Game1 game)
        {
            _game = game;
            _logo = new Objects.GameObject(_game, new Vector2(390, 20))
            {
                Texture = AssetManager.Textures[Assets.LOGO]
            };

            _btns = new Dictionary<ScreenType, GameObject>();

            var btn = new Objects.GameObject(_game, new Vector2(480, 390))
            {
                Texture = AssetManager.Textures[Assets.MENU_PLAY]
            };
            _btns.Add(Enums.ScreenType.STORY, btn);

            btn = new Objects.GameObject(_game, new Vector2(480, 445))
            {
                Texture = AssetManager.Textures[Assets.MENU_SCOREBOARD]
            };
            _btns.Add(Enums.ScreenType.HIGHSCORE, btn);

            btn = new Objects.GameObject(_game, new Vector2(480, 500))
            {
                Texture = AssetManager.Textures[Assets.MENU_OPTIONS]
            };
            //_btns.Add(Enums.ScreenType.OPTIONS, btn);

            btn = new Objects.GameObject(_game, new Vector2(480, 555))
            {
                Texture = AssetManager.Textures[Assets.MENU_STOP]
            };
            _btns.Add(Enums.ScreenType.STOP, btn);

            _pointer = new Objects.GameObject(_game, new Vector2(450, 390))
            {
                Texture = AssetManager.Textures[Assets.MENU_POINTER]
            };

            Screens.Highscore.LoadHighscore();
        }
Ejemplo n.º 8
0
        public bool Intersects(GameObject bulletObject)
        {
            int top = Math.Max(PositionRectangle.Top, bulletObject.PositionRectangle.Top);
            int bottom = Math.Min(PositionRectangle.Bottom, bulletObject.PositionRectangle.Bottom);
            int left = Math.Max(PositionRectangle.Left, bulletObject.PositionRectangle.Left);
            int right = Math.Min(PositionRectangle.Right, bulletObject.PositionRectangle.Right);

            for (int y = top; y < bottom; y++)
            {
                for (int x = left; x < right; x++)
                {
                    Color color1 = _colors[(x - PositionRectangle.Left) + (y - PositionRectangle.Top) * PositionRectangle.Width];
                    Color color2 = bulletObject.Colors[(x - bulletObject.PositionRectangle.Left) + (y - bulletObject.PositionRectangle.Top) * bulletObject.PositionRectangle.Width];

                    if (color1.A != 0 && color2.A != 0)
                        return true;
                }
            }

            return false;
        }
Ejemplo n.º 9
0
        public Level(Game1 game)
        {
            _operators = new List<string>
            {
                "*", "/"
            };

            _questions = new Dictionary<string, List<string>>();
            _questions.Add("*", new List<string>());
            _questions.Add("/", new List<string>());

            Operator = "*";

            _game = game;


            _island = new GameObject(game, new Vector2(600, 315))
            {
                Texture = AssetManager.Textures[Enums.Assets.GAME_ISLAND]
            };

            _mountain = new GameObject(game, new Vector2(630, 150))
            {
                Texture = AssetManager.Textures[Assets.GAME_MOUNTAIN_1]
            };

            _waveBack = new GameObject(game, new Vector2(-50, 550))
            {
                Texture = AssetManager.Textures[Enums.Assets.GAME_WAVE_BACK]
            };
            _waveFront= new GameObject(game, new Vector2(-90, 600))
            {
                Texture = AssetManager.Textures[Enums.Assets.GAME_WAVE_FRONT]
            };
            _waveSpeed = new Vector2(2, 0);

            _waveSpeedFront = new Vector2(0, 1f);

        }