public static void EnterKeyAction(Canvas canvas) { switch (GameTransition.gameTransition) { case GameTransitionType.Title: if (GameTransition.endSplashLogo) { Sound.bgm.Stop(); canvas.Children.Remove(ImageData.imgTitle[0]); canvas.Children.Remove(ImageData.imgTitle[1]); countTime = 0; lblMode.Content = "ゲームモード:ステージ準備"; GameTransition.gameTransition = GameTransitionType.StageInit; } break; case GameTransitionType.StageStart: if (!KeyController.keyReturnInterval) { BalloonMessage.spnBalloon.Visibility = Visibility.Hidden; BalloonMessage.txtBalloon.Text = ""; GameTransition.eventBalloonIsOpen = false; KeyController.keyReturnInterval = true; } break; case GameTransitionType.StageDuring: if (!KeyController.keyReturnInterval) { if (TalkCommander.isTalkOpenBalloon) { TalkCommander.TalkEnterTheNext(); } } break; case GameTransitionType.StageEnd: if (!KeyController.keyReturnInterval) { BalloonMessage.spnBalloon.Visibility = Visibility.Hidden; BalloonMessage.txtBalloon.Text = ""; GameTransition.eventBalloonIsOpen = false; KeyController.keyReturnInterval = true; } break; } }
public static void OnTriggerReactEvent() { if (!TalkCommander.isTalk) { TalkCommander.TalkDataInit(); TalkCommander.isTalk = true; KeyController.keyControlLocking = true; } }
public static void OnTriggerTouchEvent() { if (!TalkCommander.isTalk && !ObjectChecker.lstObject[ObjectChecker.activeObject].triggerType) { if (ObjectChecker.activeObject != ObjectChecker.oldActiveObject) { TalkCommander.TalkDataInit(); TalkCommander.isTalk = true; KeyController.keyControlLocking = true; } } }
//frameupdate protected void FrameUpdateTimer_Update(object sender, ElapsedEventArgs e) { try { this.Dispatcher.Invoke(() => { //TimeManagement this.GetNowTime(); elapsedTime = nowTime - lastTime; //debug lblDebugA.Content = PlayerStatus.playerPos.X + "," + PlayerStatus.playerPos.Y; lblDebugB.Content = SystemOperator.PixelPerSecond(PlayerStatus.weight); if (elapsedTime < 0) { elapsedTime += 59999; } KeyController.KeyInterval(); //GameTransition if (!GameTransition.duringTransition) { GameTransition.GameTransitionController(Canvas, CaLife, CaMana); } //EventAction if (GameTransition.eventStart) { if (GameTransition.lstEventTask.Count > 0) { GameTransition.EventTaskCommander(); } if (GameTransition.charaRenderStart) { GameTransition.CharaRender(); } if (GameTransition.screenFadeStart) { GameTransition.ScreenFade(Canvas); } if (!GameTransition.eventBalloonIsOpen) { if (GameTransition.eventCount < StageEvent.listEvent.Count) { GameTransition.EventController(Canvas); } } else { if (KeyController.keyReturn) { EnterKeyAction(Canvas); } } } if (KeyController.keyReturn) { EnterKeyAction(Canvas); } //got to Edit Mode if (GameTransition.gameTransition == GameTransitionType.Title) { if (KeyController.keyE) { mainCanvas.Children.Remove(ImageData.imgTitle[0]); mainCanvas.Children.Remove(ImageData.imgTitle[1]); countTime = 0; GameTransition.gameTransition = GameTransitionType.EditMode; timerFrameUpdate.Stop(); btnViewStageEditorWindow.IsEnabled = true; btnViewMaterialBrowser.IsEnabled = true; btnViewImageManager.IsEnabled = true; btnViewDatabaseWindow.IsEnabled = true; lblMode.Content = "ゲームモード:エディット"; } } //StageDuring game play if (GameTransition.gameTransition == GameTransitionType.StageDuring && !isDeactivated) { Animator.AnimationItem(); Animator.AnimationObject(); if (ObjectChecker.isTrigger && !TalkCommander.isTalk) { ObjectBehavior.OnTriggerTouchEvent(); } if (TalkCommander.isTalk && !TalkCommander.isTalkOpenBalloon) { TalkCommander.TalkWithNpc(Canvas); } if (TalkCommander.isTalkSelecting) { TalkCommander.TalkSelecting(Canvas); } //first action,last Processing including deletion of list SystemOperator.moveCommonAmountX = 0; SystemOperator.moveCommonAmountY = 0; ObjectChecker.CollisionPtoActionCollider(); PlayerBehavior.CollisionPtoE(); PlayerBehavior.MovePlayer(Canvas); PlayerBehavior.FallingPlayer(); Item.FallingItems(); EnemyBehavior.EnemyAction(); Animator.AnimationEnemy(); SubWeapon.SubWeaponPosUpdate(Canvas); if (PlayerStatus.isMainAttack) { MainWeapon.MainWeaponAttack(Canvas); MainWeapon.MainWeaponCollision(Canvas); } SubWeapon.CollisionSubWeapon(Canvas); PlayerStatus.PlayerStatusUpdate(); PlayerBehavior.DamageInvinsibleTimer(); SpawnEnemy.RemoveEnemy(Canvas); SpawnEnemy.ReSpawnEnemy(Canvas); } if (Sound.seStop) { if (Sound.sePlayTime < 60) { Sound.sePlayTime++; } else { Sound.sePlayTime = 0; Sound.seStop = false; } } lastTime = nowTime; }); } catch (TaskCanceledException) { } }