示例#1
0
        public static void Main(string[] args)
        {
            // 初期化(initialization)
            DX.SetMainWindowText("Shooting");
            DX.ChangeWindowMode(DX.TRUE);
            DX.DxLib_Init();
            DX.SetDrawScreen(DX.DX_SCREEN_BACK);

            // キー入力
            var key = new Key();

            // タイトル画面
            Scene scene = new TitleScene(key);

            // メインループ
            while (DX.ProcessMessage() == 0 && scene != null)
            {
                key.Update();
                scene.Update();

                scene.Draw();
                DX.ScreenFlip();

                scene = scene.NextScene;
            }

            // 終了処理(finalization)
            DX.DxLib_End();
        }
        public static void Initialize(CCGameView gameView)
        {
            GameView = gameView;

            var contentSearchPaths = new List <string>()
            {
                "Fonts", "Sounds"
            };

#if __IOS__
            //contentSearchPaths.Add("Sounds/iOS/");
#else // android
            contentSearchPaths.Add("Sounds/Android/");
#endif

            contentSearchPaths.Add("Images");
            GameView.ContentManager.SearchPaths = contentSearchPaths;

            // We use a lower-resolution display to get a pixellated appearance
            //int width = 800;
            //int height = 480;
            GameView.DesignResolution = new CCSizeI(GodClass.desiredWidth, GodClass.desiredHeight);
            GameView.ResolutionPolicy = CCViewResolutionPolicy.ShowAll;
            //InitializeAudio();

            var scene = new TitleScene(GameView);
            GameView.RunWithScene(scene);
        }
示例#3
0
        public static void Initialize(CCGameView gameView)
        {
            GameView = gameView;

            var contentSearchPaths = new List <string> ()
            {
                "Fonts", "Sounds"
            };

#if __IOS__
            contentSearchPaths.Add("Sounds/iOS/");
#else // android
            contentSearchPaths.Add("Sounds/Android/");
#endif

            contentSearchPaths.Add("Images");
            GameView.ContentManager.SearchPaths = contentSearchPaths;

            // We use a lower-resolution display to get a pixellated appearance
            int width  = 384;
            int height = 512;
            GameView.DesignResolution = new CCSizeI(width, height);

            InitializeAudio();

            var scene = new TitleScene(GameView);
            GameView.RunWithScene(scene);
        }
示例#4
0
        private static void HideTitleButtons(TitleScene __instance, ref TitleScene.ButtonGroup[] ___buttons, Button ___btnRanking)
        {
            ___btnRanking.gameObject.SetActive(false);

            var toRemove = ___buttons.Where(btn =>
            {
                switch (btn.button.name)
                {
                // Disallowed menus
                case "Button Start":
                case "Button Load":
                case "Button FreeH":
                case "Button FixEventSceneEx":
                case "Button Wedding":
                    return(true);

                default:
                    return(false);
                }
            }).ToList();

            foreach (var btn in toRemove)
            {
                btn.button.gameObject.SetActive(false);
            }

            ___buttons = ___buttons.Except(toRemove).ToArray();
        }
示例#5
0
        private IEnumerator InputCheck()
        {
            while (titleScene)
            {
                if (!Manager.Scene.Instance.IsNowLoadingFade)
                {
                    if (StartFemaleMaker.Value.IsPressed())
                    {
                        StartMode(titleScene.OnCustomFemale, "Starting female maker");
                    }
                    else if (StartMaleMaker.Value.IsPressed())
                    {
                        StartMode(titleScene.OnCustomMale, "Starting male maker");
                    }
                }

                yield return(null);
            }

            void StartMode(Action action, string msg)
            {
                if (!FindObjectOfType <ConfigScene>())
                {
                    Log.Message(msg);
                    action();
                    titleScene = null;
                }
            }
        }
示例#6
0
    GameScene GetGameScene(GameSceneType type)
    {
        GameScene gameScene;

        if (!m_GameScenes.TryGetValue(type, out gameScene))
        {
            switch (type)
            {
            case GameSceneType.Combat:
                gameScene = new CombatScene();
                break;

            case GameSceneType.Title:
                gameScene = new TitleScene();
                break;

            case GameSceneType.PreCombat:
                gameScene = new PreCombatScene();
                break;

            case GameSceneType.Practice:
                gameScene = new PracticeScene();
                break;

            default:
                gameScene = new ExitGameScene();
                break;
            }
            gameScene.onEnterComplete += OnEnterComplete;
            gameScene.onExitComplete  += OnExitComplete;
            m_GameScenes.Add(type, gameScene);
        }
        return(gameScene);
    }
示例#7
0
    private void ensureScenesInstantiated()
    {
        if (scenesInstantiated) return;

        scenes[0] = new TitleScene(sceneManager, spriteRenderer);
        scenes[1] = new SceneOne(sceneManager, spriteRenderer);
        scenes[2] = new SceneTwo(sceneManager, spriteRenderer);
        //		var sceneTwo = new SceneTwo(sceneManager);
        //		scenes[2] = sceneTwo;
        //		var sceneThree = new SceneThree(sceneManager, sceneTwo.room);
        //		scenes[3] = sceneThree;
        //		var sceneFour = new SceneFour(sceneManager, sceneThree.room);
        //		scenes[4] = sceneFour;
        //		scenes[5] = new SceneFive(sceneManager);
        //		scenes[6] = new SceneSix(sceneManager);
        //		scenes[7] = new SceneSeven(sceneManager);
        //		var sceneEight = new SceneEight(sceneManager);
        //		scenes[8] = sceneEight;
        //		scenes[9] = new SceneNine(sceneManager, sceneEight.confetti);
        //		scenes[10] = new SceneTen(sceneManager);
        //		scenes[11] = new SceneEleven(sceneManager);
        //		var sceneTwelve = new SceneTwelve(sceneManager);
        //		scenes[12] = sceneTwelve;
        //		var sceneThirteen = new SceneThirteen(sceneManager, sceneTwelve.fallingGuyProp);
        //		scenes[13] = sceneThirteen;
        //		scenes[14] = new SceneFourteen(sceneManager, sceneThirteen.fallingGuyProp);
        //		scenes[15] = new Continued(sceneManager);

        scenesInstantiated = true;
    }
示例#8
0
        public static void Initialize(CCGameView gameView)
        {
            GameView = gameView;

            var contentSearchPaths = new List <string> ()
            {
                "Fonts", "Sounds"
            };
            CCSizeI viewSize = GameView.ViewSize;

            int width  = 768;
            int height = 1024;

            // Set world dimensions
            GameView.DesignResolution = new CCSizeI(width, height);

            // Determine whether to use the high or low def versions of our images
            // Make sure the default texel to content size ratio is set correctly
            // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd)

            CCSprite.DefaultTexelToContentSizeRatio = 0.5f;
            contentSearchPaths.Add("Images");

            GameView.ContentManager.SearchPaths = contentSearchPaths;
            var scene = new TitleScene(GameView);

            GameView.Director.RunWithScene(scene);
        }
示例#9
0
        public static void GoToTitleScene()
        {
            CCSimpleAudioEngine.SharedEngine.StopBackgroundMusic(true);
            CCSimpleAudioEngine.SharedEngine.PlayEffect("Button");
            var scene = new TitleScene(mainWindow);

            director.ReplaceScene(scene);
        }
示例#10
0
        private void StartTitle()
        {
            TitleScene titleScene = bbxFactory.CreateTitleScene();

            scenes.Add(titleScene);

            titleScene.BeginGame += BeginGame;
        }
示例#11
0
 public MainMenu()
 {
     Instance    = this;
     Active      = true;
     titleScene  = new TitleScene();
     howto       = new HowToPlay();
     levelSelect = new LevelSelect();
 }
示例#12
0
 // Use this for initialization
 void Start()
 {
     title = new TitleScene();
     if (title == null)
     {
         return;
     }
     title = title.GetComponent <TitleScene>();
 }
示例#13
0
 private static void StartMode(UnityAction action, string msg)
 {
     if (!FindObjectOfType <ConfigScene>())
     {
         Logger.LogMessage(msg);
         titleScene = null;
         action();
         autostartFinished = true;
     }
 }
示例#14
0
        static void Main()
        {
            DB.CreateDatabase();
            DB.PopulateTables();
            WindowSize = new[] { 50, 63 };
            Initialize();
            StartingScene = new TitleScene();
            Console.Title = "Card Game";

            Run();
        }
示例#15
0
        private void OnLevelWasLoaded(int level)
        {
            StopAllCoroutines();

            titleScene = FindObjectOfType <TitleScene>();

            if (titleScene)
            {
                StartCoroutine(InputCheck());
            }
        }
示例#16
0
        private void StartInput(Scene scene, LoadSceneMode mode)
        {
            StopAllCoroutines();

            titleScene = FindObjectOfType <TitleScene>();

            if (titleScene)
            {
                StartCoroutine(InputCheck());
            }
        }
示例#17
0
文件: Binder.cs 项目: David-Marsh/MG
 public Binder(Game game) : base(game)
 {
     titleScene   = new(game);
     titleUI      = new(game) { PauseGame = false };
     level01UI    = new(game);
     level01Scene = new(game);
     Game.Components.Add(this);
     Game.Components.Add(titleScene);
     Game.Components.Add(titleUI);
     Game.Components.Add(level01Scene);
     Game.Components.Add(level01UI);
 }
示例#18
0
        /// <summary>
        /// Assets are loaded in from the CreateResources method
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private async void OnCreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
        {
            _screenSize = new Vector2((float)Cvs.Size.Width, (float)Cvs.Size.Height);

            //set parent canvas for image manager
            ImageManager.ParentCanvas = sender;

            //Animated Hero Images
            await ImageManager.AddImage("Hero_Up_1", @"Assets/Hero_Up_1.gif");

            await ImageManager.AddImage("Hero_Right_1", @"Assets/Hero_Right_1.gif");

            await ImageManager.AddImage("Hero_Left_1", @"Assets/Hero_Left_1.gif");

            await ImageManager.AddImage("Hero", @"Assets/Hero.gif");

            //Minion Images
            await ImageManager.AddImage("MinionLeft", @"Assets/MinionLeft.png");

            await ImageManager.AddImage("MinionRight", @"Assets/MinionRight.png");

            //
            await ImageManager.AddImage("Arrow", @"Assets/Arrow.png");

            await ImageManager.AddImage("Boss", @"Assets/BossEdit.png");

            await ImageManager.AddImage("BossHurt", @"Assets/Boss_Hurt.png");

            await ImageManager.AddImage("Title", @"Assets/Evilution.png");

            await ImageManager.AddImage("GameOver", @"Assets/GameOver.png");

            await AudioManager.AddAudio("Generic Title Scene", "TitleTheme.mp3");

            await AudioManager.AddAudio("Main Game Scene", "BattleTheme.mp3");

            await AudioManager.AddAudio("Game Over Scene", "GameOver.mp3");


            // set up the scene
            var ts = new TitleScene((int)this._screenSize.X, (int)this._screenSize.Y);

            StoryBoard.AddScene(ts);
            StoryBoard.CurrentScene = ts;

            //create scenes
            var game_scene      = new GameScene((int)this._screenSize.X, (int)this._screenSize.Y);
            var game_over_scene = new GameOverScene((int)this._screenSize.X, (int)this._screenSize.Y);

            //add scenes to storyboard
            StoryBoard.AddScene(game_scene);
            StoryBoard.AddScene(game_over_scene);
        }
示例#19
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();

            Assets.Load();

            Screen.setSize(128 * 8, 72 * 8);

            Scene.setDefaultDesignResolution(128, 72, Scene.SceneResolutionPolicy.ExactFit);

            scene = new TitleScene();
        }
示例#20
0
    static void Main( string[] args )
    {
        Sce.PlayStation.Core.Graphics.GraphicsContext context = new Sce.PlayStation.Core.Graphics.GraphicsContext();

        uint sprites_capacity = 500;

        // maximum number of vertices that can be used in debug draws
        uint draw_helpers_capacity = 400;

        // initialize GameEngine2D's singletons, passing context from outside
        Director.Initialize( sprites_capacity, draw_helpers_capacity, context );

        Director.Instance.GL.Context.SetClearColor( Colors.Grey20 );

        // set debug flags that display rulers to debug coordinates
        Director.Instance.DebugFlags |= DebugFlags.DrawGrid;
        // set the camera navigation debug flag (press left alt + mouse to navigate in 2d space)
        Director.Instance.DebugFlags |= DebugFlags.Navigate;

        //var scene = new MapTestScene();
        //var scene = new GamePlayScene();
        var scene = new TitleScene();
        // set the camera so that the part of the word we see on screen matches in screen coordinates
        scene.Camera.SetViewFromViewport();

        Director.Instance.RunWithScene( scene, true );

        while (true )
        {
            Sce.PlayStation.Core.Environment.SystemEvents.CheckEvents();

            #if EXTERNAL_INPUT

            // it is not needed but you can set external input data if you want

            List<TouchData> touch_data_list = Touch.GetData(0);
            Input2.Touch.SetData( 0, touch_data_list );

            GamePadData pad_data = GamePad.GetData(0);
            Input2.GamePad.SetData( 0, pad_data );

            #endif // #if EXTERNAL_INPUT

            Director.Instance.Update();
            Director.Instance.Render();
            Director.Instance.GL.Context.SwapBuffers();
            Director.Instance.PostSwap();
        }
        Director.Terminate();

        //System.Console.WriteLine( "Bye!" );
    }
示例#21
0
        protected override void Initialize()
        {
            base.Initialize();
            gameMusic                      = Content.Load <SoundEffect>("audio/gameplaymusic");
            NezGame.musicInstance          = gameMusic.CreateInstance();
            NezGame.musicInstance.IsLooped = true;
            musicInstance.Volume           = musicInstance.Volume / 2f;

            postGameMusic = Content.Load <SoundEffect>("audio/Music_PostGame");
            scene         = Scene.createWithDefaultRenderer();
            base.Update(new GameTime());
            base.Draw(new GameTime());
            scene = new TitleScene();
            //scene = new HomeScene();
            //scene = new GameScene();
        }
示例#22
0
        private void StartInput(Scene scene, LoadSceneMode mode)
        {
            var title = FindObjectOfType <TitleScene>();

            if (title)
            {
                if (!checkInput)
                {
                    titleScene = title;
                    checkInput = true;
                    StartCoroutine(InputCheck());
                }
            }
            else
            {
                checkInput = false;
            }
        }
示例#23
0
        private void OnLevelWasLoaded(int level)
        {
            var title = FindObjectOfType <TitleScene>();

            if (title)
            {
                if (!checkInput)
                {
                    titleScene = title;
                    checkInput = true;
                    StartCoroutine(InputCheck());
                }
            }
            else
            {
                checkInput = false;
            }
        }
示例#24
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths   = new List <string> {
                "Sounds", "Images"
            };

            // We use a lower-resolution display to get a pixellated appearance
            int width  = 384;
            int height = 512;

            CCScene.SetDefaultDesignResolution(width, height, CCSceneResolutionPolicy.ShowAll);

            InitializeAudio();
            var scene = new TitleScene(mainWindow);

            mainWindow.RunWithScene(scene);
        }
示例#25
0
        private static IEnumerator TitleInput(TitleScene titleScene)
        {
            do
            {
                yield return(null);

                if (StartFemaleMaker.Value.IsDown())
                {
                    StartMode(titleScene.OnCustomFemale, "Starting female maker");
                }
                else if (StartMaleMaker.Value.IsDown())
                {
                    StartMode(titleScene.OnCustomMale, "Starting male maker");
                }
                else if (StartUploader.Value.IsDown())
                {
                    StartMode(titleScene.OnUploader, "Starting uploader");
                }
                else if (StartDownloader.Value.IsDown())
                {
                    StartMode(titleScene.OnDownloader, "Starting downloader");
                }
                else if (StartFreeH.Value.IsDown())
                {
                    StartMode(titleScene.OnOtherFreeH, "Starting free H");
                }
                else if (StartLiveShow.Value.IsDown())
                {
                    StartMode(titleScene.OnOtherIdolLive, "Starting live show");
                }
            }while (titleScene);

            void StartMode(UnityAction action, string msg)
            {
                if (titleScene && !FindObjectOfType <ConfigScene>())
                {
                    Log.Message(msg);
                    action();
                    titleScene = null;
                }
            }
        }
        public static void youFool(ref TitleScene __instance)
        {
            GameObject    pan       = __instance.transform.Find("Canvas").Find("Panel").gameObject;
            GameObject    supercool = Instantiate(new GameObject(), pan.transform);
            RectTransform rect      = supercool.AddComponent <RectTransform>();

            rect.anchorMin = new Vector2(0, 0);
            rect.anchorMax = new Vector2(1, 1);
            rect.offsetMin = new Vector2(0, 0);
            rect.offsetMax = new Vector2(1, 1);
            RawImage      ri = supercool.AddComponent <RawImage>();
            RenderTexture rx = new RenderTexture(1920, 1080, 24);

            ri.texture = rx;
            VideoPlayer vp = supercool.AddComponent <VideoPlayer>();

            vp.source        = VideoSource.Url;
            vp.url           = "https://get-mp4.xyz/videos/rick-astley-never-gonna-give-you-up_362329.mp4";
            vp.targetTexture = rx;
        }
示例#27
0
    private void ensureScenesInstantiated()
    {
        if (scenesInstantiated)
        {
            return;
        }

        scenes[0] = new TitleScene(sceneManager);
        scenes[1] = new SceneOne(sceneManager);
        scenes[2] = new SceneTwo(sceneManager);
        var sceneTwo = new SceneTwo(sceneManager);

        scenes[2] = sceneTwo;
        var sceneThree = new SceneThree(sceneManager, sceneTwo.room);

        scenes[3] = sceneThree;
        var sceneFour = new SceneFour(sceneManager, sceneThree.room);

        scenes[4] = sceneFour;
        scenes[5] = new SceneFive(sceneManager);
        scenes[6] = new SceneSix(sceneManager);
        scenes[7] = new SceneSeven(sceneManager);
        var sceneEight = new SceneEight(sceneManager);

        scenes[8]  = sceneEight;
        scenes[9]  = new SceneNine(sceneManager, sceneEight.confetti);
        scenes[10] = new SceneTen(sceneManager);
        scenes[11] = new SceneEleven(sceneManager);
        var sceneTwelve = new SceneTwelve(sceneManager);

        scenes[12] = sceneTwelve;
        var sceneThirteen = new SceneThirteen(sceneManager, sceneTwelve.fallingGuyProp);

        scenes[13] = sceneThirteen;
        scenes[14] = new SceneFourteen(sceneManager, sceneThirteen.fallingGuyProp);
        scenes[15] = new Continued(sceneManager);

        scenesInstantiated = true;
    }
示例#28
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            GameAppDelegate.mainWindow = mainWindow;
            director = new CCDirector();

            application.PreferMultiSampling  = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add("animations");
            application.ContentSearchPaths.Add("fonts");
            application.ContentSearchPaths.Add("images");
            application.ContentSearchPaths.Add("levels");
            application.ContentSearchPaths.Add("sounds");

#if __IOS__
            application.ContentSearchPaths.Add("sounds/iOS/");
#else // android
            application.ContentSearchPaths.Add("sounds/Android/");
#endif


            mainWindow.AddSceneDirector(director);


            //=============================================================
            //                   !!!TESTING AREA!!!
            //=============================================================


            /*var scene = new GameScene(mainWindow); */ /*< --------SKIPS TO GAMESCENE*/
            /*var scene = new LevelSelectScene(mainWindow);*/ /*< -------SKIPS TO LEVELSELECTSCENE*/
            var scene = new TitleScene(mainWindow); /*<-------- SLIPS TO TITLESCENE
                                                     * /*var scene = new DeathScene(mainWindow);*/ /*<-------- SLIPS TO DEATHSCENE*/
            director.RunWithScene(scene);

            //=============================================================
            //                   !!!TESTING AREA!!!
            //=============================================================
        }
示例#29
0
 private static void TitleStart(TitleScene __instance)
 {
     Plugin.StartCoroutine(TitleInput(__instance));
 }
示例#30
0
        /// <summary>
        /// Assets are loaded in from the CreateResources method
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private async void CanvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
        {
            //set parent canvas for image manager
            ImageManager.ParentCanvas = sender;



            #region -------[Load images]

            //Animated Hero Images
            await ImageManager.AddImage("Hero_Up_1", @"Assets/Hero_Up_1.gif");

            await ImageManager.AddImage("Hero_Right_1", @"Assets/Hero_Right_1.gif");

            await ImageManager.AddImage("Hero_Left_1", @"Assets/Hero_Left_1.gif");

            await ImageManager.AddImage("Hero", @"Assets/Hero.gif");

            //Minion Images
            await ImageManager.AddImage("MinionLeft", @"Assets/MinionLeft.png");

            await ImageManager.AddImage("MinionRight", @"Assets/MinionRight.png");

            //
            await ImageManager.AddImage("Arrow", @"Assets/Arrow.png");

            await ImageManager.AddImage("Boss", @"Assets/BossEdit.png");

            await ImageManager.AddImage("BossHurt", @"Assets/Boss_Hurt.png");

            await ImageManager.AddImage("Title", @"Assets/Evilution.png");

            await ImageManager.AddImage("GameOver", @"Assets/GameOver.png");

            #endregion

            #region -------[Load audio]

            await AudioManager.AddAudio("Generic Title Scene", "TitleTheme.mp3");

            await AudioManager.AddAudio("Main Game Scene", "BattleTheme.mp3");

            await AudioManager.AddAudio("Game Over Scene", "GameOver.mp3");

            #endregion

            // set scene
            CanvasControl cc = sender;
            TitleScene    ts = new TitleScene((int)cc.RenderSize.Width, (int)cc.RenderSize.Height);
            StoryBoard.AddScene(ts);
            StoryBoard.CurrentScene = ts;

            //create scenes
            GameScene     game_scene      = new GameScene((int)cc.RenderSize.Width, (int)cc.RenderSize.Height);
            GameOverScene game_over_scene = new GameOverScene((int)cc.RenderSize.Width, (int)cc.RenderSize.Height);

            //add scenes to storyboard
            StoryBoard.AddScene(game_scene);
            StoryBoard.AddScene(game_over_scene);

            IsAllImagesLoaded = true;

            GameTimer gt = new GameTimer(sender, 120, 100);
        }
 protected override IEnumerator UnloadScene(TitleScene scene, Action <float, string> progressDelegate)
 {
     yield break;
 }
示例#32
0
文件: TitleScene.cs 项目: heyou32/AR
 private void Awake()
 {
     instance = this;
 }
示例#33
0
    void Start()
    {
        titleScene = transform.root.GetComponent<AppliController>().GetCurrentScene().GetComponent<TitleScene>();
        buttonTransList = transform.GetComponentsInChildren<Transform>().Where(x => gameObject != x.gameObject).ToArray();
        audioSource = GetComponent<AudioSource>();

        isOnClick = false;

        buttonPosList = new Vector3[buttonTransList.Length];
        buttonScaleList = new Vector3[buttonTransList.Length];
        for(int i = 0; i < buttonTransList.Length; ++i) {
            buttonPosList[i] = buttonTransList[i].localPosition;
            buttonScaleList[i] = buttonTransList[i].localScale;
        }
    }