// Update is called once per frame void Update() { switch (_currentGameStatus) { case GameStatus.Start: // 턴 시작 _currentTurn++; // 턴 증가 _currentGameStatus = GameStatus.InGame; break; case GameStatus.InGame: // (임시) 인게임 if (Input.GetMouseButtonDown(0)) { RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector3.forward); if (hit.collider != null) { } } break; case GameStatus.End: // 턴 종료 if (_currentTurn >= MaxTurn) Debug.Log("턴 제한"); else if (_resourcesManager.CurrentDebt <= _resourcesManager.CurrentGold) Debug.Log("클리어"); _currentGameStatus = GameStatus.Start; break; default: // 오류 처리 break; } }
public void GameOver() { state = GameStatus.End; m_LevelController.OnGameOver(); m_UIManager.OnGameOver(); m_UIManager.gameOverPanel.SetFinalScore(score); }
public static GameStatus getInstance() { if (instance == null) { instance = GameObject.FindObjectOfType<GameStatus>(); } return instance; }
protected override void Awake() { base.Awake(); _gameStatus = GameStatus.Instance; Subscribe(); UpdateRate = FrameUpdateFrequency.Normal; enabled = false; }
public Game(int mapWidth, int mapHeight, int roadWidth, int roadHeigth, Point startPoint) { this._ball = new Ball(startPoint); this.GameMap = new GameMap(mapWidth, mapHeight, roadWidth, roadHeigth, startPoint, _ball); this.TotalScore = 0; this._status = GameStatus.ReadyToStart; }
public void GameOver() { if(currentGameStatus == GameStatus.Over) return; AD.SetActive(true); currentGameStatus = GameStatus.Over; startUI.GetComponent<Animator>().SetTrigger("Show"); if(playerControl !=null){ audioSource.clip = audioHit; if(playSound){ audioSource.Play(); } Destroy(playerControl); } PlayerPrefs.SetInt("BestScore",bestScore); GameObject[] enemys = GameObject.FindGameObjectsWithTag("Enemy"); foreach(GameObject en in enemys){ Destroy(en); } if(enableGameCenter){ Social.ReportScore(bestScore,gameCenterKey, result => { }); } }
void GoToStory() { gameStatus = GameStatus.STORY; timer = 20.0f; startHolder.SetActive(false); storyHolder.SetActive(true); }
/// <summary> /// Sets the status of a cell /// </summary> /// <param name="row">Row number of cell</param> /// <param name="column">Column number of cell</param> /// <param name="status">New status of cell</param> public void Play(int row, int column, CellStatus status) { if (row < MIN_ROW_COLUMN || row > MAX_ROW_COLUMN) { throw new ArgumentOutOfRangeException(nameof(row), $"'{nameof(row)}' should be between {MIN_ROW_COLUMN} and {MAX_ROW_COLUMN}"); } if (column < MIN_ROW_COLUMN || column > MAX_ROW_COLUMN) { throw new ArgumentOutOfRangeException(nameof(column), $"'{nameof(column)}' should be between {MIN_ROW_COLUMN} and {MAX_ROW_COLUMN}"); } if (status != CellStatus.X && status != CellStatus.O) { throw new ArgumentException(nameof(status), $"'{nameof(status)}' '{status}' is invalid"); } if (_cells[row, column] != CellStatus.Unmarked) { throw new InvalidOperationException($"Cell with row={row} and column={column} is already marked"); } _cells[row, column] = status; if (Status == GameStatus.New) { Status = GameStatus.InProgress; } }
void GotToGameover() { gameStatus = GameStatus.GAMEOVER; gamePaused = true; gameplayHolder.SetActive(false); gameoverHolder.SetActive(true); }
public void GameOver() { Final_Meter.text = string.Format("{0:N0} m", Meter); Final_Item.text = string.Format("{0}", Item); GS = GameStatus.End; Final_GUI.SetActive (true); }
public void StartNewGame() { //TODO: Go to "story" first status = new GameStatus(); StartCoroutine(LoadAsync("Preperation")); }
/// <summary> /// /// </summary> /// <param name="eventManager"></param> public Game(EventManager eventManager) { this.gameStatus = GameStatus.Preparing; this.eventManager = eventManager; this.players = new ArrayList(); this.players.Add(new Player(eventManager)); this.map = new Map(eventManager); }
/// <summary> /// Creates a new game /// </summary> /// <param name="path">The path to the game</param> /// <param name="name">The name of the game</param> /// <param name="fileCount">The number of files in the game</param> /// <param name="status">The current status of the game</param> /// <param name="size">The total size of the game</param> public Game(string path, string name, long size, int fileCount, GameStatus status = GameStatus.Deactivated) { Path = path; Name = name; Size = size; FileCount = fileCount; Status = status; }
public GameStatusUpdate(Guid token, Guid gameToken, GameStatus status, IActorRef game, string message = null) : base(token, gameToken) { Status = status; Game = game; Message = message; }
/// <summary> /// Initializes a new instance of the <see cref="ShipNavigator"/> class. /// </summary> /// <param name="t">Ship Transform</param> /// <param name="data">Ship data.</param> public ShipNavigator(Transform t, ShipData data) : base(data) { _transform = t; _gameStatus = GameStatus.Instance; _generalSettings = GeneralSettings.Instance; _engineRoom = new EngineRoom(data, t.rigidbody); Subscribe(); }
public void PlayGame() { state = GameStatus.Started; m_UIManager.OnGamePlay(); m_UIManager.SetScore(0); OneRoundTime = 60.0f; m_UIManager.SetTime(OneRoundTime); m_LevelController.PlayGame(); }
void Start() { this.game_status = this.gameObject.GetComponent<GameStatus>(); this.player_control = GameObject.Find("Player").GetComponent<PlayerControl>(); this.step = STEP.PLAY; this.next_step = STEP.PLAY; this.guistyle.fontSize = 64; }
// Use this for initialization void Start() { money = 100; currentMonster = 0; lastMonsterSpawnTime = Time.time; status = GameStatus.GamePlay; currentLevelNumber = 0; }
protected override void Awake() { base.Awake(); _gameStatus = GameStatus.Instance; orbitPeriod = orbitPeriod ?? new GameTimePeriod(days: 0, years: 1); _orbitSpeed = (relativeOrbitSpeed * Constants.DegreesPerOrbit * GeneralSettings.Instance.DaysPerSecond) / orbitPeriod.PeriodInDays; Subscribe(); UpdateRate = FrameUpdateFrequency.Frequent; enabled = false; }
// Use this for initialization void Start () { _inst = this; _totalTime = Database.GetTime(GameStatus.Level); _time = Database.GetTime(GameStatus.Level); TargetScore = ArrowCount = Database.GetArrowCount(GameStatus.Level); MoveSpeed = Database.GetMoveSpeed(); HP = Database.GetHP(GameStatus.Level); }
IEnumerator LoadLevelMain() { AsyncOperation async = Application.LoadLevelAdditiveAsync ("Main"); yield return async; if (async.isDone) { GameObject loginRoot = GameObject.Find("LoginRoot"); DestroyImmediate(loginRoot); this.Status = GameStatus.BeforeFight; } }
public void Adds_Players() { var gameStatus = new GameStatus("foo"); var player = new Player(); gameStatus.AddPlayer(player); gameStatus.Players.Count().ShouldEqual(1); gameStatus.Players.First().ShouldEqual(player); }
void GoToCountdown() { gameStatus = GameStatus.COUNTDOWN; timer = 4.0f; ResetGame(); gameoverHolder.SetActive(false); instructionsHolder.SetActive(false); countdownHolder.SetActive(true); }
// Update is called once per frame void Update() { // RESTART if (status == GameStatus.RESTART) { status = GameStatus.PLAY; } if (Input.GetKey(KeyCode.Escape)) { //status = GameStatus.PAUSE; } }
public void InitView(GameStatus game_status) { currentStatus = new RoundStatus(); SetNames(game_status.PlayerNamesk__BackingField.ToArray()); lbl_state.Content = "Bidding"; lbl_strong_shape.Content = ""; UpdateTakes(new[] { 0, 0, 0, 0 }); UpdateBids(new[] { "", "", "", "" }); UpdateScores(game_status.Scoresk__BackingField.ToArray()); ShowCards(new Card?[4] { null, null, null, null }); }
public Model(int amountTanks, int speedGame, int amountWalls) { this.amountTanks = amountTanks; this.speedGame = speedGame; this.amountWalls = amountWalls; tank = new Tank(); wall = new Wall(); gameStatus = GameStatus.STOP; }
public Engine(IRenderer renderer, IInterface userInterface, IGameInitializationStrategy gameInitializationStrategy) { this.renderer = renderer; this.userInterface = userInterface; this.gameInitializationStrategy = gameInitializationStrategy; this.ships = new List<IShip>(); this.hiddenGrid = new Grid(); this.visibleGrid = new Grid(); this.totalAttempts = 0; this.gameStatus = GameStatus.Play; }
public void RestartGame() { score = 0; OneRoundTime = 60.0f; m_UIManager.SetTime(OneRoundTime); m_UIManager.SetScore(score); m_UIManager.OnGamePlay(); m_LevelController.RestartLevel(); m_IceBlockManager.Clear(); state = GameStatus.Started; }
void Container_Tap(object sender, System.Windows.Input.GestureEventArgs e) { if (_gameStatus == GameStatus.EsperandoJogar) { _gameStatus = GameStatus.EmJogo; var position = e.GetPosition(this.Container); Circle especialCircle = Circle.CreateSpecialCircle(position); this.AdicionarNoContainer(especialCircle); } }
IEnumerator Tick() { for (int i = 3; i > 0; i--) { tickText.text = i.ToString(); yield return new WaitForSeconds(1.0f); } tickText.text = "GO!!!!!"; yield return new WaitForSeconds(0.5f); tickText.text = ""; status = GameStatus.InGame; }
public void EndLevel() { mainPlayer.EnableShooting(false); Debug.Log("End level"); gameStatus = GameStatus.Transitioning; }
private void Awake() { gameStatus = transform.parent.Find("GameStatus").GetComponent <GameStatus>(); HealthBar = transform.parent.Find("GameCanvas").Find("HealthBar"); }
public void setGameStatus(GameStatus gamestatus) { gameStatus = gamestatus; }
public void ChangeGameStatus(GameStatus newStatus, bool restart = false) { if (newStatus == GameStatus.Loose) { // Audio Registry.AudioManager.MusicVolume = 0.2f; Registry.AudioManager.SpeakAsync("Mission failed ! You're ship has been destroyed !"); // Interface gameUI.Kill(); // Aliens _ennemyManager.Kill(); // Joueurs if (_player.Active) { _player.Kill(); } // Messages _looseTimer.Start(); messageBoxManager.ActiveMessageBox(MessageBoxType.End); } else if (newStatus == GameStatus.Paused) { _ennemyManager.Enabled = false; _player.Enabled = false; gameUI.Enabled = false; messageBoxManager.ActiveMessageBox(MessageBoxType.Pause); } else if (newStatus == GameStatus.Running) { _ennemyManager.Enabled = true; _player.Enabled = true; gameUI.Active = true; messageBoxManager.DesactiveMessageBoxes(); } else if (newStatus == GameStatus.Starting) { Registry.AudioManager.SpeakAsync("Get ready !"); _ennemyManager.Enabled = false; _player.Enabled = false; messageBoxManager.ActiveMessageBox(MessageBoxType.Start); } else if (newStatus == GameStatus.Success) { Registry.AudioManager.StopMusic(); YnG.SwitchState(new ScoreState(true)); } else if (newStatus == GameStatus.Quit) { Registry.AudioManager.StopMusic(); YnG.SwitchState(new ScoreState(true)); } else if (newStatus == GameStatus.Died) { Registry.AudioManager.StopMusic(); YnG.SwitchState(new ScoreState(true)); } gameStatus = newStatus; if (restart) { RestartScene(); } }
public void SetGameStatus(GameStatus _gameStatus) { gameStatus = _gameStatus; }
public GameInitialEvent(string id, int version, DateTimeOffset occuredDate, GameId gameId, IReadOnlyCollection <Team> teams, GameStatus status, string score) : base(id, version, occuredDate) { GameId = gameId; Teams = teams; Status = status; Score = score; }
public GameInitialEvent(GameId gameId, IReadOnlyCollection <Team> teams, GameStatus status, string score) : this(Guid.NewGuid().ToString(), 1, DateTimeOffset.Now, gameId, teams, status, score) { }
// Use this for initialization void Start() { thisGame = FindObjectOfType <GameStatus>(); thisBall = FindObjectOfType <Ball>(); }
private void GoToControls() { gameStatus = GameStatus.ControlsMenu; uiManager.SetScreensActive(gameStatus); }
private void Start() { gameStats = FindObjectOfType <GameStatus>(); CountBreakableBlocks(); }
public void ResetScore() { GameStatus.GetInstance().ResetScore(); }
/// <summary> /// ゲームの開始処理。 /// </summary> void StartGame() { audioManager.PlayBGM(); status = GameStatus.Playing; }
public void ReloadGame() { gameStatus = GameStatus.Start; SceneManager.LoadScene(SceneManager.GetActiveScene().name); Time.timeScale = 1; }
void Start() { isDead = false; gameStatus = GameObject.Find("EventSystem").GetComponent <GameStatus>(); }
public IEnumerator FinalKillCam(ReplayEvents killCamEvents) { mainPlayer.EnableShooting(false); yield return(new WaitForSeconds(3)); enemyManager.KillAllEnemies(); gameStatus = GameStatus.KillCam; Time.timeScale = 0.5f; uiManager.SetScreensActive(gameStatus); //init enemies Dictionary <long, string> enemyDeathDelay = killCamEvents.killTimes.ToDictionary(item => long.Parse(item.Key), item => item.Value); long initialTime = long.Parse(killCamEvents.events.First().Value.First().Key); enemyManager.Initialize(killCamEvents.enemies, levels[currentLevel].transform, levels[currentLevel].GetPlayerPads(), true, enemyDeathDelay, initialTime); enemyManager.StartGame(); yield return(enemyManager); Dictionary <string, ReplayEvent> events; long timestamp; foreach (KeyValuePair <string, Dictionary <string, ReplayEvent> > playerEvent in killCamEvents.events) { var split = playerEvent.Key.Split(':'); string enemyId = split[0]; string id = split[1]; events = playerEvent.Value; Debug.Log($"Replaying enemy {enemyId} kill event by player {id}"); //set camera mainCamera.position = allPlayers[id].playerCamera.position; mainCamera.rotation = allPlayers[id].playerCamera.rotation; mainCamera.SetParent(allPlayers[id].playerCamera, true); long prevTime = long.Parse(events.Keys.First()); foreach (string ts in events.Keys) { timestamp = long.Parse(ts); yield return(new WaitForSeconds((timestamp - prevTime) / 1000f)); prevTime = timestamp; ReplayEvent e = events[ts]; if (e.type == "remoteState") { RemoteStateUpdateReceived(e.remoteState); } else if (e.type == "enemyKilled") { EnemyKilledMessageReceived(e.enemyKilled); } } allPlayers[id].SetShooting(false); } Time.timeScale = 1f; yield return(new WaitForSeconds(3)); currentLevel++; StartCoroutine(TransitionFromLevel(false)); }
public void ResumeGame() { gameStatus = GameStatus.Playing; uiManager.SetScreensActive(gameStatus); mainPlayer.EnableShooting(true); }
public void Start() { gameStatus = FindObjectOfType <GameStatus>(); PopulateMenu(); }
public IEnumerator Init(GameStatistics gameStatistics) { m_allies.Clear(); m_opponents.Clear(); m_availableStats.Clear(); RepeatedField <GameStatistics.Types.PlayerStats> playerStats = gameStatistics.PlayerStats; for (int i = 0; i < playerStats.get_Count(); i++) { GameStatistics.Types.PlayerStats playerStats2 = playerStats.get_Item(i); for (int j = 0; j < playerStats2.Titles.get_Count(); j++) { FightStatType item = (FightStatType)playerStats2.Titles.get_Item(j); if (!m_availableStats.Contains(item)) { m_availableStats.Add(item); } } if (GameStatus.GetFightStatus(playerStats2.FightId).TryGetEntity(playerStats2.PlayerId, out PlayerStatus entityStatus) && entityStatus.heroStatus != null) { PlayerStatData playerStatData = default(PlayerStatData); playerStatData.name = entityStatus.nickname; playerStatData.weaponDefinition = (WeaponDefinition)entityStatus.heroStatus.definition; playerStatData.playerStats = playerStats2; PlayerStatData item2 = playerStatData; if (GameStatus.localPlayerTeamIndex == entityStatus.teamIndex) { item2.ally = true; m_allies.Add(item2); } else { item2.ally = false; m_opponents.Add(item2); } } } PlayerStatDataComparer comparer = new PlayerStatDataComparer(); m_allies.Sort(comparer); m_opponents.Sort(comparer); if (GameStatus.fightType == FightType.TeamVersus) { m_teamScoreLine.get_gameObject().SetActive(true); m_allyTeamScore.SetText(GameStatus.allyTeamPoints.ToString()); m_opponentTeamScore.SetText(GameStatus.opponentTeamPoints.ToString()); } else { m_teamScoreLine.get_gameObject().SetActive(false); } bool displayOpponent = m_opponents.Count > 0 || GameStatus.fightType != FightType.BossFight; m_versusImage.get_gameObject().SetActive(displayOpponent); m_versusBloom.get_gameObject().SetActive(displayOpponent); yield return(m_playerLine.Init(m_allies, m_opponents, displayOpponent)); m_statLines[0].Init(m_allies, m_opponents, FightStatType.TotalDamageDealt, displayOpponent); m_statLines[1].Init(m_allies, m_opponents, FightStatType.TotalDamageSustained, displayOpponent); m_statLines[2].Init(m_allies, m_opponents, FightStatType.PlayTime, displayOpponent); m_statLines[3].Init(m_allies, m_opponents, FightStatType.TotalKills, displayOpponent); InitOptionnalLine(m_statLines[4], FightStatType.CompanionGiven, displayOpponent); InitOptionnalLine(m_statLines[5], FightStatType.BudgetPointsDiff, displayOpponent); InitOptionnalLine(m_statLines[6], FightStatType.BudgetPointsWon, displayOpponent); }
private void GoToSettings() { gameStatus = GameStatus.SettingsMenu; uiManager.SetScreensActive(gameStatus); }
void Start() { gameStatus = FindObjectOfType <GameStatus>(); ball = FindObjectOfType <Ball>(); }
private void GoToMainMenu() { gameStatus = GameStatus.MainMenu; uiManager.SetScreensActive(gameStatus); }
public void PauseGame() { gameStatus = GameStatus.Paused; uiManager.SetScreensActive(gameStatus); mainPlayer.EnableShooting(false); }
private void applySettings() { inputManager.InitInputs(); gameStatus = GameStatus.Start; uiManager.SetScreensActive(gameStatus); }
public void WaitForPlayers() { gameStatus = GameStatus.Waiting; uiManager.EnterWaitingRoom(); }
private void Start() { status = FindObjectOfType <GameStatus>(); }
void Awake() { Instance = this; }
public void ChangeModel() { if (isNormal && SpecialGauge >= 100) { if (Input.GetKeyDown(KeyCode.R)) { GameStatus.SetCurrentGameState(CurrentGameState.Product); isSpecial = true; SetInvincibility(true); TimeLine.SetActive(true); SetState(PlayerState.TRANS); //SetState(PlayerState.IDLE); // 스킬 1번 사라졌다 나오게 하기. Skill1Return(Skill1_Effects, Skill1_Special_Effects, isNormal); Skill1Return(Skill1_Shoots, Skill1_Special_Shoots, isNormal); Skill1PositionSet(Skill1_Effects, Skill1_Shoots, Skill1_Special_Shoots, isNormal); if (!Normal.activeSelf) { Normal.SetActive(true); } // 스킬2번 바닥 사라지게하기. if ((isNormal && Skill2_Test.activeSelf) || (!isNormal && Skill2_Test2.activeSelf)) { Skill2_Test.SetActive(false); Skill2_Test2.SetActive(false); isSkill2End = false; } } } if (isSpecial) {//11.6초후변신끝 WeaponTransformEffect.SetActive(true); specialTimer += Time.deltaTime; //if (specialTimer >= 0.6833f && !isTrans1) //{ //isTrans1 = true; //SetState(PlayerState.TRANS); //} if (specialTimer >= 1.5f) { isNormal = false; WeaponTransformEffect.SetActive(false); Special.SetActive(true); } if (specialTimer >= 2f) { Normal.SetActive(false); } if (specialTimer >= 5.82f) { Change_Effect.SetActive(false); //SetState(PlayerState.IDLE); } if (specialTimer >= 6.7f) { specialTimer = 0; TimeLine.SetActive(false); isSpecial = false; isAttackOne = false; SpecialGauge = 100; StartCoroutine(SetOff()); return; } } }
// Start is called before the first frame update void Start() { theGameStatus = FindObjectOfType <GameStatus>(); theBall = FindObjectOfType <Ball>(); }
public (bool validateResult, Exception exception) Validate(WinPoint cmd, string team1Id, string team2Id, GameStatus status) { var exceptions = new List <Exception>(); if (status == GameStatus.End) { exceptions.Add(new WinPointException("Game status has been End.", status)); } if (new[] { team1Id, team2Id }.Any(o => o == cmd.TeamId) == false) { exceptions.Add(new WinPointException("The specific team id is not exist.", cmd.TeamId)); } return(exceptions.Count == 0, new AggregateException(exceptions)); }
public void NewGame(NewGameRequest request) { Board = new Board(); Status = GameStatus.Ok; Board.Build(request.XLength, request.YLength, request.Bombs); }