Exemple #1
0
        private IEnumerable Intro(Story story, EntityWorld world)
        {
            var bgGenerator = ServiceLocator.Instance.GetService<SpaceBackgroundGeneratorService>();
            bgGenerator.GenerateBackground(world, 12345);

            var entity = world.CreateStoryOverlay(Properties.Resources.String_ActOne_Intro01);

            yield return Coroutine.WaitFor(TimeSpan.FromSeconds(2));
            entity.FadeGuiElement(TimeSpan.FromSeconds(1.5), 0)
                .OnDone = () => entity.Delete();
            yield return Coroutine.WaitFor(TimeSpan.FromSeconds(2));

            var variant = new ShipVariant
            {
                HullId = "Jormugand",
                TrimDecalColor = Color.Cyan,
                BaseDecalColor = new Color(212, 113, 108),
            };
            _playerEntity = world.CreateShip(variant, new Vector2(500,0),0, physics:true);
            _playerEntity.Tag = "PlayerShip";
            _playerEntity.Refresh();
            var cameraControl = world.SystemManager.GetSystem<Systems.CameraControlSystem>();
            cameraControl.Mode = Systems.CameraMode.FollowEntity;
            cameraControl.FollowedEntity = _playerEntity;

            var test = world.CreateShip("mobius", new Vector2(0, 0), MathHelper.Pi * 1.5f, physics:true);
            test.GetComponent<ShipModelComponent>().BaseDecalColor = Color.Khaki;

            story.State.Fire(Story.Triggers.NextScene);
            yield return null;
        }
Exemple #2
0
 private IEnumerable Tutorial(Story story, EntityWorld world)
 {
     var entity = world.CreateStoryOverlay(Properties.Resources.String_ActOne_Tutorial01,"");
     yield return Coroutine.WaitFor(TimeSpan.FromSeconds(2));
     entity.FadeGuiElement(TimeSpan.FromSeconds(1.5), 0)
         .OnDone = () => entity.Delete();
     yield return Coroutine.WaitFor(TimeSpan.FromSeconds(2));
     story.State.Fire(Story.Triggers.NextScene);
 }