Inheritance: MonoBehaviour
Example #1
0
 public GameScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.Gameplay)
 {
     dropTimer        = 0;
     lastItemPickup   = "";
     levelUpMsg       = "";
     levelUpDisplayed = false;
     vx                 = 0;
     vy                 = 0;
     foodVy             = 0;
     friction           = 1;
     distance           = 0;
     levelNum           = 1;
     playerIsMoving     = false;
     playerIsJumping    = false;
     musicIsPlaying     = false;
     foodValueDisplayed = false;
     foodManager        = new FoodManager(content);
     deathTimer         = new Timer();
     deathTimer.SetTimer(0, 0, DOOM_TIME);//5 seconds
     timerStarted  = false;
     gameOver      = false;
     gameOverTimer = new Timer();
     gameOverTimer.SetTimer(0, 0, 5);
 }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        //if on android, tap will go to arcade game screen
#if UNITY_ANDROID
        MobileInput();

        /*
         * if (MobileInput.getInput() == MobileInput.InputType.up)
         * {
         *  ChangeScreen.SwitchScreen();
         * }
         * else if (MobileInput.getInput() == MobileInput.InputType.tap)
         * {
         *  ChangeScreen.SwitchScreen();
         * }
         */
#endif


        //if on desktop, enter will go to arcade game screen
        if (Input.GetKeyDown("return"))
        {
            ChangeScreen.SwitchScreen();
        }
    }
Example #3
0
        /// <summary>
        /// コンストラクタ
        /// (new で実体生成された際、一番最初に一回呼び出される)
        /// </summary>
        public Game1()
        {
            IGConfig.IGConfigLoad();
            //グラフィックスデバイス管理者の実体生成
            graphicsDeviceManager = new GraphicsDeviceManager(this);
            if (IGConfig.isFullScreen)
            {
                System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.PrimaryScreen;
                int tempsWidth  = screen.Bounds.Width;
                int tempsHeight = screen.Bounds.Height;
                tempScreen = new InfinityGame.Element.Size(tempsWidth, tempsHeight);

                if (IGConfig.screen.Width > tempsWidth)
                {
                    IGConfig.screen.Width = tempsWidth;
                }
                if (IGConfig.screen.Height > tempsHeight)
                {
                    IGConfig.screen.Height = tempsHeight;
                }
                ChangeScreen.ChangeResolution(IGConfig.screen.Width, IGConfig.screen.Height);
            }
            graphicsDeviceManager.PreferredBackBufferWidth  = IGConfig.screen.Width;
            graphicsDeviceManager.PreferredBackBufferHeight = IGConfig.screen.Height;
            graphicsDeviceManager.IsFullScreen = IGConfig.isFullScreen;
            //コンテンツデータ(リソースデータ)のルートフォルダは"Contentに設定
            Content.RootDirectory = "Content";
            IGConfig.MNCT         = Content;
            //IsMouseVisible = true;
        }
Example #4
0
    void MobileInput()
    {
        // user is touching the screen with one finger
        if (Input.touchCount == 1)
        {
            Touch touch = Input.GetTouch(0);

            //get coordinates of the first touch
            if (touch.phase == TouchPhase.Began)
            {
                fp = touch.position;
                lp = touch.position;
            }
            //update the last position based on where they moved
            else if (touch.phase == TouchPhase.Moved)
            {
                lp = touch.position;
            }
            //check if the finger is removed from the screen
            else if (touch.phase == TouchPhase.Ended)
            {
                lp = touch.position;

                //User has touched the screen;
                //   whether it was a tap or a swipe, proceed to minigame menu
                Debug.Log("Tap");
                ChangeScreen.SwitchScreen();
            }
        }
    }
Example #5
0
        public Screen(Game game, SpriteBatch batch, ChangeScreen changeScreen, BackButtonScreenType backButtonScreenType)
        {
            Screen.game    = game;
            Screen.content = game.Content;
            Screen.batch   = batch;

            changeScreenDelegate = changeScreen;
            touchIndicator       = new TouchIndicatorCollection();

            if (music == null)
            {
                music = new Music(content);
            }

            if (soundEffects == null)
            {
                soundEffects = new SoundEffects(content);
            }

            if (!isHighScoresLoaded)
            {
                highScores.Load();
                isHighScoresLoaded = true;
            }

            this.backButtonScreenType = backButtonScreenType;
        }
Example #6
0
        private void ChangeScreenToCreateServer()
        {
            ChangeScreen changeScreen      = ChangeScreenToStartServer;
            var          endpointViewModel = new EndpointViewModel(changeScreen);
            var          connectControl    = new EndpointControl(endpointViewModel);

            Control = connectControl;
        }
 private void DeadTimeEvent()
 {
     deadTime++;
     if (deadTime >= deadTimeGoal)
     {
         ChangeScreen?.Invoke(this, EventArgs.Empty);
     }
 }
Example #8
0
        private void ChangeScreenToStartServer()
        {
            ChangeScreen changeScreen = ChangeScreenToCreateServer;
            var          viewModel    = new ViewLogViewModel(changeScreen);
            var          control      = new ViewLogControl(viewModel);

            Control = control;
        }
Example #9
0
 public Screen(Game game, SpriteBatch batch, ChangeScreen changeScreen, GraphicsDeviceManager graphics)
 {
     Screen.game = game;
     Screen.content = game.Content;
     Screen.batch = batch;
     Screen.graphics = graphics;
     changeScreenDelegate = changeScreen;
 }
Example #10
0
        public MainViewModel()
        {
            ChangeScreen changeScreen   = ChangeScreenToRegistration;
            var          connectModel   = new ConnectViewModel(changeScreen);
            var          connectControl = new ConnectControl(connectModel);

            Control = connectControl;
        }
Example #11
0
        private void CloseExec()
        {
            Task.Run(async() =>
            {
                ChangeScreen?.Invoke(_homeVM, eTransitionType.SlideOutFromRight);

                await Task.Delay(500);
                _homeVM.FixAirspace = false;
            });
        }
Example #12
0
 /// <summary>
 /// ゲームが終了中
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 protected override void OnExiting(object sender, EventArgs args)
 {
     if (IGConfig.isFullScreen)
     {
         ChangeScreen.ChangeResolution(tempScreen.Width, tempScreen.Height);
     }
     gameRun.IsGameRun = false;
     Thread.Sleep(500);
     base.OnExiting(sender, args);
 }
Example #13
0
        public Screen(Game game, SpriteBatch batch, ChangeScreen changeScreen, BackButtonScreenType backButtonScreenType)
        {
            Screen.game    = game;
            Screen.content = game.Content;
            Screen.batch   = batch;

            changeScreenDelegate = changeScreen;
            touchIndicator       = new TouchIndicatorCollection();

            this.backButtonScreenType = backButtonScreenType;
        }
Example #14
0
 public Screen(Game game,
               SpriteBatch spriteBatch,
               ChangeScreen changeScreen)
 {
     Screen.game = game;
     Screen.content = game.Content;
     Screen.spriteBatch = spriteBatch;
     changeScreenDelegate = changeScreen;
     touchIndicator = new TouchIndicatorCollection();
     if (music == null)
         music = new Music(content);
     if (soundEffects == null)
         soundEffects = new SoundEffects(content);
 }
Example #15
0
        public Screen(Game game, SpriteBatch batch, ChangeScreen changeScreen, GraphicsDeviceManager graphics)
        {
            Screen.game = game;
            Screen.content = game.Content;
            Screen.batch = batch;
            Screen.graphics = graphics;
            changeScreenDelegate = changeScreen;

            if (music == null)
            {
                music = new Music(content);
            }

            if (soundEffects == null)
            {
                soundEffects = new SoundEffects(content);
            }
        }
Example #16
0
 public MainGame(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen)
     : base(game, spriteBatch, changeScreen)
 {
     isTouchIndicatorEnabled = true;
 }
Example #17
0
 public GameOver(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen)
     : base(game, spriteBatch, changeScreen)
 {
 }
Example #18
0
 public Title(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.First)
 {
 }
Example #19
0
 public GameScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.Gameplay)
 {
 }
Example #20
0
 public InGameMenu(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.InGameMenu)
 {
 }
Example #21
0
 public OptionsScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.Options)
 {
 }
Example #22
0
 protected void OnScreenChanged(object sender, EventArgs eventArgs)
 {
     Music.Stop();
     ChangeScreen?.Invoke(this, EventArgs.Empty);
 }
Example #23
0
 public void OnScreenChanged()
 {
     ChangeScreen?.Invoke(this, EventArgs.Empty);
 }
Example #24
0
 public CreditsScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.Other)
 {
 }
Example #25
0
 public Tutorial(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.Other)
 {
 }
Example #26
0
 public LevelSelect(Game game, SpriteBatch batch, ChangeScreen changeScreen)
     : base(game, batch, changeScreen, BackButtonScreenType.LevelSelect)
 {
 }
Example #27
0
 internal virtual void OnChangeScreen(ThakurEscapeGame.ScreenType screenType)
 {
     ChangeScreen?.Invoke(this, screenType);
 }
Example #28
0
 public void InvokeChangeScreen(IScreen screen)
 {
     ChangeScreen?.Invoke(screen, eTransitionType.SlideInFromLeft);
 }
Example #29
0
 public InGameMenu(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen)
     : base(game, spriteBatch, changeScreen)
 {
 }
 public Gameplay(Game game, SpriteBatch batch, ChangeScreen changeScreen, GraphicsDeviceManager graphics)
     : base(game, batch, changeScreen, graphics)
 {
 }
Example #31
0
 public Title(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen)
     : base(game, spriteBatch, changeScreen)
 {
 }