コード例 #1
0
        protected override void Initialize()
        {
            base.Initialize();

            Window.Title             = GAME_TITLE;
            Window.AllowUserResizing = false;

            // Register context service
            services.AddService(typeof(GameContext), _gameContext);

            var uiAssets = new UiAssets();

            uiAssets.load();
            services.AddService(uiAssets);

            var resolutionPolicy = Scene.SceneResolutionPolicy.ShowAllPixelPerfect;

            if (_gameContext.configuration.graphics.scaleMode ==
                GameConfiguration.GraphicsConfiguration.ScaleMode.Stretch)
            {
                resolutionPolicy = Scene.SceneResolutionPolicy.BestFit;
            }

            Scene.setDefaultDesignResolution(gameResolution.X, gameResolution.Y, resolutionPolicy);

            // Fixed timestep for physics updates
            IsFixedTimeStep = true;

            scene = new IntroScene();
        }
コード例 #2
0
ファイル: MainMenu.cs プロジェクト: darkzter/Librelancer
        public MainMenu(FreelancerGame g) : base(g)
        {
            g.GameData.LoadHardcodedFiles();
            g.GameData.PopulateCursors();
            g.MouseVisible = false;

            logoOverlay = g.GameData.GetFreelancerLogo();

            g.WillClose       += G_WillClose;
            manager            = new UIManager(g);
            manager.MenuButton = g.GameData.GetMenuButton();
            manager.Clicked   += (tag) => lastTag = tag;
            ConstructMainMenu();

            intro = g.GameData.GetIntroScene();
            scene = new Cutscene(intro.Scripts, Game);
            scene.Update(TimeSpan.FromSeconds(1f / 60f)); //Do all the setup events - smoother entrance
            GC.Collect();                                 //crap
            g.Sound.PlayMusic(intro.Music);

#if DEBUG
            g.Keyboard.KeyDown += Keyboard_KeyDown;
#endif
            cur = g.ResourceManager.GetCursor("arrow");
            GC.Collect();             //GC before showing
        }
コード例 #3
0
ファイル: LuaMenu.cs プロジェクト: Regenhardt/Librelancer
        public LuaMenu(FreelancerGame g) : base(g)
        {
            api        = new MenuAPI(this);
            ui         = Game.Ui;
            ui.GameApi = api;
            ui.Visible = true;
            ui.OpenScene("mainmenu");
            g.GameData.PopulateCursors();
            g.CursorKind = CursorKind.None;
            intro        = g.GameData.GetIntroScene();
            scene        = new Cutscene(new ThnScriptContext(null), Game.GameData, Game.RenderContext.CurrentViewport, Game);
            scene.BeginScene(intro.Scripts);
            FLLog.Info("Thn", "Playing " + intro.ThnName);
            cur = g.ResourceManager.GetCursor("arrow");
            GC.Collect(); //crap
            g.Sound.PlayMusic(intro.Music);
            g.Keyboard.KeyDown   += UiKeyDown;
            g.Keyboard.TextInput += UiTextInput;
#if DEBUG
            g.Keyboard.KeyDown += Keyboard_KeyDown;
#endif
            Game.Saves.Selected = -1;
            if (g.LoadTimer != null)
            {
                g.LoadTimer.Stop();
                FLLog.Info("Game", $"Initial load took {g.LoadTimer.Elapsed.TotalSeconds} seconds");
                g.LoadTimer = null;
            }
            FadeIn(0.1, 0.3);
        }
コード例 #4
0
ファイル: LuaMenu.cs プロジェクト: Regenhardt/Librelancer
 void LoadSpecific(int index)
 {
     intro = Game.GameData.GetIntroSceneSpecific(index);
     scene.Dispose();
     scene.BeginScene(intro.Scripts);
     scene.Update(1 / 60.0); //Do all the setup events - smoother entrance
     Game.Sound.PlayMusic(intro.Music);
 }
コード例 #5
0
 void Start()
 {
     IntroSceneInstance = this;
     FirstMeteorHit     = false;
     foreach (GameObject zone in GameController.GameControllerInstance.Zones.Values)
     {
         zone.GetComponent <RevitalizeZone>().RevitalizeTheZoneInstant();
     }
     mainCamera.enabled = true;
 }
コード例 #6
0
        private void CustomLoad()
        {
            dataLoader        = new DataLoader();
            Global.dataLoader = dataLoader;
            dataLoader.LoadAllContent(contentManager);

            intro          = new IntroScene(this);
            action         = new ActionScene(this);
            editor         = new EditorScene(this);
            input          = new InputManager(scene);
            Global.Running = true;

            Global.p = contentManager.Load <Texture2D>("Images/UI/white");
            //MediaPlayer.Play(Content.Load<Song>("Audio/Music/KnuxTheme"));
        }
コード例 #7
0
ファイル: MainMenu.cs プロジェクト: darkzter/Librelancer
 void Keyboard_KeyDown(KeyEventArgs e)
 {
     if (e.Key >= Keys.D1 && e.Key <= Keys.D9)
     {
         var i = (int)e.Key - (int)Keys.D1;
         var r = Game.GameData.GetIntroSceneSpecific(i);
         if (r == null)
         {
             return;
         }
         intro = r;
         scene = new Cutscene(intro.Scripts, Game);
         scene.Update(TimeSpan.FromSeconds(1f / 60f)); //Do all the setup events - smoother entrance
         Game.Sound.PlayMusic(intro.Music);
         GC.Collect();                                 //crap
     }
 }
コード例 #8
0
ファイル: main.cs プロジェクト: AaronPelzer/TextAdventure
    public static void Reset()
    {
        intro    = false;
        kitchen  = false;
        street   = false;
        mansion  = false;
        breakf   = false;
        sneakUse = false;
        fakeUse  = false;
        timeUse  = false;
        hideUse  = false;

        p.invReset();

        IntroScene iScene = new IntroScene();

        iScene.Intro();
    }
コード例 #9
0
 void Start()
 {
     introScene = new IntroScene();
     introScene.Initialize();
     nutsAmount        = 0;
     NameOffspringMenu = GameObject.Find("InputNames");
     player            = GameObject.Find("Player").GetComponent <CharacterController>();
     //nutsAmountUI = GameObject.Find("NutsAmount").GetComponent<TextMeshProUGUI>();
     timerImage    = GameObject.Find("Timer").GetComponent <Image>();
     timerBorder   = GameObject.Find("TimerBorder").GetComponent <Image>();
     camObject     = GameObject.Find("Camera");
     PostProc      = GameObject.Find("Post-process Volume").GetComponent <PostProcessVolume>();
     camController = camObject.GetComponent <CameraController>();
     roundTimer    = roundLengthSeconds;
     //NameOffspringMenu.SetActive(false);
     SpawnHoles();
     cage = Object.Instantiate(tutorialCagePrefab, Vector3.zero, Quaternion.identity);
     clock.SetActive(false);
 }
コード例 #10
0
ファイル: LuaMenu.cs プロジェクト: lyzardiar/Librelancer
        public LuaMenu(FreelancerGame g) : base(g)
        {
            api = new LuaAPI(this);
            ui  = new XmlUIManager(g, "menu", api, g.GameData.GetInterfaceXml("mainmenu"));
            ui.OnConstruct();
            ui.Enter();
            g.GameData.PopulateCursors();
            g.CursorKind = CursorKind.None;
            intro        = g.GameData.GetIntroScene();
            scene        = new Cutscene(intro.Scripts, Game);
            scene.Update(TimeSpan.FromSeconds(1f / 60f)); //Do all the setup events - smoother entrance
            cur = g.ResourceManager.GetCursor("arrow");
            GC.Collect();                                 //crap
            g.Sound.PlayMusic(intro.Music);
#if DEBUG
            g.Keyboard.KeyDown += Keyboard_KeyDown;
#endif
            FadeIn(0.1, 0.3);
        }
コード例 #11
0
        public LuaMenu(FreelancerGame g) : base(g)
        {
            api        = new MenuAPI(this);
            ui         = new UiContext(g);
            ui.GameApi = new MenuAPI(this);
            widget     = ui.CreateAll("mainmenu.xml");
            g.GameData.PopulateCursors();
            g.CursorKind = CursorKind.None;
            intro        = g.GameData.GetIntroScene();
            scene        = new Cutscene(new ThnScriptContext(intro.Scripts), Game.GameData, Game.Viewport, Game);
            scene.Update(TimeSpan.FromSeconds(1f / 60f)); //Do all the setup events - smoother entrance
            FLLog.Info("Thn", "Playing " + intro.ThnName);
            cur = g.ResourceManager.GetCursor("arrow");
            GC.Collect(); //crap
            g.Sound.PlayMusic(intro.Music);
#if DEBUG
            g.Keyboard.KeyDown += Keyboard_KeyDown;
#endif
            FadeIn(0.1, 0.3);
        }
コード例 #12
0
 private void SetScene(GameScene scene)
 {
     this.scene = scene;
     if (scene.kind == Scene.LOAD)
     {
         load = (LoadScene)scene;
     }
     else if (scene.kind == Scene.INTRO)
     {
         intro = (IntroScene)scene;
     }
     else if (scene.kind == Scene.ACTION)
     {
         action = (ActionScene)scene;
     }
     else if (scene.kind == Scene.EDITOR)
     {
         editor = (EditorScene)scene;
     }
 }
コード例 #13
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            Window.Title             = GameTitle;
            Window.AllowUserResizing = false;

//            Core.defaultSamplerState = gameContext.configuration.graphics.antialiasing ? SamplerState.LinearClamp : SamplerState.PointClamp;

            // Fixed timestep for physics updates
            IsFixedTimeStep = true;

            // Add content source for asset pak file
            if (File.Exists(PackedContentFile))
            {
                contentSource.addContentSource(
                    new PakFileContentSource(new PakFile(File.OpenRead(PackedContentFile))), 0);
            }

            // Register code assets
            services.AddService(typeof(UiAssets), new UiAssets());

            // Register context service
            services.AddService(typeof(GameContext), gameContext);

            var resolutionPolicy = Scene.SceneResolutionPolicy.ShowAllPixelPerfect;

            if (gameContext.configuration.graphics.scaleMode ==
                GameConfiguration.GraphicsConfiguration.ScaleMode.Stretch)
            {
                resolutionPolicy = Scene.SceneResolutionPolicy.BestFit;
            }

            Scene.setDefaultDesignResolution(defaultResolution.X, defaultResolution.Y, resolutionPolicy);

            var introScene = new IntroScene();

            scene = introScene;
        }
コード例 #14
0
ファイル: main.cs プロジェクト: AaronPelzer/TextAdventure
    public static void Main(string[] args)
    {
        //Console.WriteLine prints to the console
        Console.WriteLine("Welcome to Picky Pocket's Quest For Greatness. \r\n" + "This is a text adventure! Make sure to type commands to progress the story.\r\n" + "Items you can interact, locations you can visit, and action you can take with will be CAPITALIZED. \r\n" + "Enjoy! \r\n \r\n" + "====================== ");

        //Calls the Intro Scene
        IntroScene iScene = new IntroScene(); //Create intro Scene

        iScene.Intro();                       //Call Intro Method of intro scene

        if (kitchen == true)
        {                                             //If Intro Scene is done
            KitchenScene kScene = new KitchenScene(); //Create kitchen Scene
            kScene.Kitchen();                         //Call kitchen Method of Kitchen scene
        }

        if (street == true)
        {                                           //If Kitchen Scene is done
            StreetScene sScene = new StreetScene(); //Create Street scene
            sScene.Street();                        //Call Street Method of Street Scene
        }
    }
コード例 #15
0
 protected override IEnumerator UnloadScene(IntroScene scene, Action<float, string> progressDelegate)
 {
     yield break;
 }
コード例 #16
0
 // Use this for initialization
 void Start()
 {
     text       = GetComponent <Text>();
     color      = text.color;
     introScene = FindObjectOfType <IntroScene>();
 }
コード例 #17
0
 protected override IEnumerator UnloadScene(IntroScene scene, Action <float, string> progressDelegate)
 {
     yield break;
 }
コード例 #18
0
 // parses intro scene; pos is the line number of the scene in file
 // returns line number at the end of this scene in file
 int parseIntroScene(string[] lines, int pos, int curr_scene)
 {
     scene_arr [curr_scene] = new IntroScene();
     return(pos);
 }
コード例 #19
0
 public WooferController()
 {
     RenderingUnit = new WooferRenderingUnit(this);
     ActiveScene   = new IntroScene();
 }
コード例 #20
0
ファイル: IntroState.cs プロジェクト: fnatte/TowerDefence
 public IntroState(GameStateManager gameStateManager, SceneManager sceneManager, IntroScene introScene) : base(gameStateManager)
 {
     this.introScene   = introScene;
     this.sceneManager = sceneManager;
 }