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); }
// 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(); } }
/// <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; }
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(); } } }
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; }
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); } }
private void ChangeScreenToStartServer() { ChangeScreen changeScreen = ChangeScreenToCreateServer; var viewModel = new ViewLogViewModel(changeScreen); var control = new ViewLogControl(viewModel); Control = control; }
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; }
public MainViewModel() { ChangeScreen changeScreen = ChangeScreenToRegistration; var connectModel = new ConnectViewModel(changeScreen); var connectControl = new ConnectControl(connectModel); Control = connectControl; }
private void CloseExec() { Task.Run(async() => { ChangeScreen?.Invoke(_homeVM, eTransitionType.SlideOutFromRight); await Task.Delay(500); _homeVM.FixAirspace = false; }); }
/// <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); }
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; }
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); }
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); } }
public MainGame(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen) : base(game, spriteBatch, changeScreen) { isTouchIndicatorEnabled = true; }
public GameOver(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen) : base(game, spriteBatch, changeScreen) { }
public Title(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.First) { }
public GameScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.Gameplay) { }
public InGameMenu(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.InGameMenu) { }
public OptionsScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.Options) { }
protected void OnScreenChanged(object sender, EventArgs eventArgs) { Music.Stop(); ChangeScreen?.Invoke(this, EventArgs.Empty); }
public void OnScreenChanged() { ChangeScreen?.Invoke(this, EventArgs.Empty); }
public CreditsScreen(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.Other) { }
public Tutorial(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.Other) { }
public LevelSelect(Game game, SpriteBatch batch, ChangeScreen changeScreen) : base(game, batch, changeScreen, BackButtonScreenType.LevelSelect) { }
internal virtual void OnChangeScreen(ThakurEscapeGame.ScreenType screenType) { ChangeScreen?.Invoke(this, screenType); }
public void InvokeChangeScreen(IScreen screen) { ChangeScreen?.Invoke(screen, eTransitionType.SlideInFromLeft); }
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) { }
public Title(Game game, SpriteBatch spriteBatch, ChangeScreen changeScreen) : base(game, spriteBatch, changeScreen) { }