Exemplo n.º 1
0
        public override void Begin()
        {
            base.Begin();

            Background = new Background("Sprites/Spritesheets/tile_spritesheet_0.png", "Maps/bg_map_scene1");
            Add(Background);

            ObjectMap objectMap = new ObjectMap("Sprites/Spritesheets/tile_spritesheet_0.png", "Maps/object_map_scene1");

            Add(objectMap);

            Door door = new Door(new Vector2(5 * 16, 11 * 16), 16, 16, new Nazarek());

            Add(door);

            Add(Game1.Player);

            EverythingRenderer er = new EverythingRenderer();

            Camera          = new PlayerCamera(640, 360, Engine.Width * 1 / 3, Engine.Height * 1 / 3);
            Camera.Position = new Vector2(Game1.Player.Position.X - Engine.Width / 2, Game1.Player.Position.Y - Engine.Height / 2);
            er.Camera       = Camera;
            Add(er);

            Vector2 newScreenCenter          = Camera.ScreenToCamera(new Vector2(Engine.Width / 2, Engine.Height / 2));
            PlayerCameraStaticBound camDebug = new PlayerCameraStaticBound(newScreenCenter, Engine.Width * 1 / 3, Engine.Height * 1 / 3);

            Add(camDebug);

            NPC aisya = Game1.NPCDict["Aisya"];

            aisya.Position = new Vector2(5 * 16, 3 * 16);
            Add(aisya);
        }
Exemplo n.º 2
0
        public override void Begin()
        {
            base.Begin();

            // Add the EverythingRenderer object so it will actually display the contents of the scene
            EverythingRenderer er = new EverythingRenderer();

            Add(er);

            // Setup the camera
            camera = new Camera(640, 360);
            camera.CenterOrigin();
            camera.Zoom = 1.5f;
            er.Camera   = camera; // Attach the new camera to the EverythingRenderer

            // Create the dummy
            dum = new Dummy();
            Vector2 screenHalf = (new Vector2(Engine.Width, Engine.Height)) / 2;

            dum.Position = screenHalf;
            Add(dum);

            // Create walls (mainly to limit the movement of the dummy and to test collisions)
            CreateWallBorder();
            AdditionalWalls();
        }
Exemplo n.º 3
0
        public override void Begin()
        {
            base.Begin();

            var renderer = new EverythingRenderer();

            Add(renderer);
        }
Exemplo n.º 4
0
        public override void Begin()
        {
            base.Begin();

            EverythingRenderer renderer = new EverythingRenderer();

            Add(renderer);

            camera = new Camera();
            camera.CenterOrigin();
        }
Exemplo n.º 5
0
        public override void Begin()
        {
            base.Begin();

            Background = new Background("Sprites/Spritesheets/tile_spritesheet_0.png", "Maps/nazarek_map");
            Add(Background);

            House house1 = new House(1, new Vector2(4 * 16, 2 * 16));

            Add(house1);

            House house0 = new House(0, new Vector2(21 * 16, 2 * 16));

            Add(house0);

            Door door0 = new Door(new Vector2(house0.X + 16, house0.Y + 16 * 4), 16, 16);

            door0.Add(new CoDialogue("LOCKED001DOOR"));
            door0.Locked = true;
            Add(door0);

            Door door1 = new Door(new Vector2(house1.X + 30, house1.Y + 62), 21, 17, new Scene1());

            Add(door1);

            Door southExit = new Door(new Vector2(13 * 16, 29 * 16), 4 * 16, 2 * 16, new NazarekSouth());

            Add(southExit);

            Add(Game1.Player);

            EverythingRenderer er = new EverythingRenderer();

            Camera          = new PlayerCamera(640, 360, Engine.Width * 1 / 3, Engine.Height * 1 / 3);
            Camera.Position = new Vector2(Game1.Player.Position.X - Engine.Width / 2, Game1.Player.Position.Y - Engine.Height / 2);
            er.Camera       = Camera;
            Add(er);

            Vector2 newScreenCenter          = Camera.ScreenToCamera(new Vector2(Engine.Width / 2, Engine.Height / 2));
            PlayerCameraStaticBound camDebug = new PlayerCameraStaticBound(newScreenCenter, Engine.Width * 1 / 3, Engine.Height * 1 / 3);

            Add(camDebug);

            Monsters monster = new Zaletos(new Vector2(14 * 16 - 8, 14 * 16 - 8));

            Add(monster);
        }
Exemplo n.º 6
0
        public override void Begin()
        {
            base.Begin();

            if (!Game1.NazSouthIntro)
            {
                Game1.Player.Position = new Vector2(9 * 16, 12 * 16);
                Game1.GameDialogue    = new CoDialogue("NAZSOUTH001INTRO", OnComplete);
                Game1.GameDialogue.StartDialogue();
            }

            // background
            Background = new Background("Sprites/Spritesheets/tile_spritesheet_0.png", "Maps/nazarek_south_map");
            Add(Background);
            ObjectMap objectMap = new ObjectMap("Sprites/Spritesheets/tile_spritesheet_0.png", "Maps/nazarek_south_object_map");

            Add(objectMap);

            // player
            Add(Game1.Player);

            // renderer
            EverythingRenderer er = new EverythingRenderer();

            Camera          = new PlayerCamera(640, 360, Engine.Width * 1 / 3, Engine.Height * 1 / 3);
            Camera.Position = new Vector2(Game1.Player.Position.X - Engine.Width / 2, Game1.Player.Position.Y - Engine.Height / 2);
            er.Camera       = Camera;
            Add(er);

            // objects
            Entity sign = new Entity(new Vector2(6 * 16, 2 * 16));

            sign.Collider = new Hitbox(16, 16);
            sign.Add(new CoDialogue("NAZSOUTH001SIGN"));
            Add(sign);

            // exits
            Door northExit = new Door(new Vector2(5 * 16, -8), 128, 16, new Nazarek());

            Add(northExit);
        }
Exemplo n.º 7
0
        public override void Begin()
        {
            base.Begin();

            EverythingRenderer renderer = new EverythingRenderer();

            Add(renderer);

            camera = new Camera(640, 360);
            camera.CenterOrigin();
            camera.Zoom     = 1.5f;
            renderer.Camera = camera;

            player = new Player();
            Vector2 screenHalf = (new Vector2(Engine.Width, Engine.Height)) / 2;

            player.Position = screenHalf;
            Add(player);

            genWalls();
        }
Exemplo n.º 8
0
        public override void Begin()
        {
            base.Begin();
            StartButton = new MenuButton(new Vector2(230, 30), "start", true);
            Add(StartButton);

            OptionsButton = new MenuButton(new Vector2(230, 90), "options", true);
            Add(OptionsButton);

            ExitButton = new MenuButton(new Vector2(230, 150), "exit", true);
            Add(ExitButton);

            Buttons.Add(StartButton);
            Buttons.Add(OptionsButton);
            Buttons.Add(ExitButton);
            StartButton.Sprite.Play("selected");

            EverythingRenderer er = new EverythingRenderer();

            Add(er);
        }
Exemplo n.º 9
0
        public override void Begin()
        {
            Instance = this;
            base.Begin();

            Renderer renderer = new EverythingRenderer();
            var      wave     = 1;

            EnemyTimer = Alarm.Create(Alarm.AlarmMode.Persist, () => { GenerateEnemy(wave); wave++; }, 3.0f, false);
            var colorTimer = Alarm.Create(Alarm.AlarmMode.Looping, null, 60, true);

            colorTimer.OnComplete = () => {
                var bulletList = GetEntitiesByTagMask(Game1.DeadBulletTag);
                foreach (Bullet bullet in bulletList)
                {
                    var oldColor = bullet.BulletImage.Color.ToVector3();
                    if (MathHelper.Max(oldColor.X, MathHelper.Max(oldColor.Y, oldColor.Z)) > 0.5f)
                    {
                        var newColor         = oldColor * 0.8f;
                        var progress         = 0.0f;
                        var bulletColorTimer = Alarm.Create(Alarm.AlarmMode.Looping, null, 0.01f, true);
                        bulletColorTimer.OnComplete = () => {
                            if (progress >= 1.0f)
                            {
                                bulletColorTimer.RemoveSelf();
                            }
                            bullet.BulletImage.Color = new Color(Vector3.Lerp(oldColor, newColor, progress));
                            progress += 0.01f;
                        };
                        bullet.Add(bulletColorTimer);
                    }
                }
            };
            Add(new Entity()
            {
                colorTimer
            });

            PlayerHPImage               = new Image(Game1.PlayerHPImageArray[0]);
            PlayerHPImage.Position      = new Vector2(50.0f, 80.0f);
            PlayerBombNumImage          = new Image(Game1.BombNumImageArray[0]);
            PlayerBombNumImage.Position = new Vector2(400.0f, 80.0f);

            Add(renderer);
            Add(new Entity()
            {
                new Image(Game1.BGImage)
            });
            Add(new Entity()
            {
                PlayerHPImage
            });
            Add(new Entity()
            {
                PlayerBombNumImage
            });
            Add(Player.Instance);
            Add(Cursor.Instance);
            Player.Instance.Add(EnemyTimer);

            GenerateEnemy();
        }