static void Main(string[] args) { RenderEngine.SetScreenSize(20); Board board = new Board(); Player playerOne = new Player(); Player playerTwo = new Player(); WinLose winlose = new WinLose(); LoopController loopController = new LoopController(); KeyHandler keyHandler = new KeyHandler(); while (winlose.Check(board)) { // Clear the screen Console.Clear(); // Render the screen //RenderEngine.FillScreen(); RenderEngine.Draw(); // Get player Input keyHandler.Input(); keyHandler.Update(board); // Slow GameLoop loopController.Wait(10); } }
public void Attacked(float attack, WinLose enemyWinLose, bool canonShot = false) { if (canonShot) { StartCoroutine("BecanonShot"); } if (!beattack) { beattack = true; StartCoroutine("AnimationAttacked"); } float damage = attack; if (enemyWinLose == WinLose.win) { damage *= 2; } else if ((enemyWinLose == WinLose.lose)) { damage = damage / 2; } TakeDamage(damage); if (currentHp <= 0) { killed = true; _Die(); } }
private void OnTriggerExit(Collider other) { if (other.gameObject.tag == "PlayArea") { gameObject.SetActive(false); WinLose.DisplayWinner(transform.parent.gameObject.name); } }
void Start() { EndMenu.SetActive(false); sequence = GameObject.FindGameObjectWithTag("Spawner").GetComponent <Sequence>(); winLose = GameObject.FindGameObjectWithTag("ResultManager").GetComponent <WinLose>(); player1 = winLose.player1; player2 = winLose.player2; }
private void Awake() { if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; } }
public Bot(string name, Statuses status, Turns turn, Orders order) { this.name = name; this.status = status; this.turn = turn; this.order = order; strategue = Strategues.WAITING; WinLose = WinLose.LOSE; GameStrategue = Strategues.PASS; hand = new List <Divide>(); copyHand = new List <Divide>(); expectVzyatki = new int(); }
void GetComponents() { playerWave = GameObject.FindGameObjectWithTag("WavePlayer"); sgp = playerWave.GetComponent <SignalGeneratorPlayer>(); ampMeter = GameObject.FindGameObjectWithTag("AmpMeter"); if (ampMeter != null) { print("Got amp found"); } am = ampMeter.GetComponent <AmpMeter>(); global = GameObject.FindGameObjectWithTag("GlobalScripts"); wl = global.GetComponent <WinLose>(); }
public void checkState() { if (healthScore == 0) { WinLose.ForeColor = Color.Red; WinLose.Text = "You Lose"; WinLose.Focus(); } else if (pointScore == 10) { WinLose.ForeColor = Color.Yellow; WinLose.Text = "You Won!"; WinLose.Focus(); } }
void Start() { board = FindObjectOfType <BoardManager>(); // add different tiles to inventory list that the inventory counter will keep track of. TODO: refactor this to use variables instead of hard coding tile names TileInventory.Add("Red Tile", 0); TileInventory.Add("Pink Tile", 0); TileInventory.Add("Green Tile", 0); TileInventory.Add("Black Tile", 0); TileInventory.Add("Orange Tile", 0); TileInventory.Add("Blue Tile", 0); wlConditions = FindObjectOfType <WinLose>(); _sc = FindObjectOfType <SelectorController>(); _ldh = FindObjectOfType <LevelDataHolder>(); }
public void GamePlayingMethod() { WinLose obj = new WinLose(); int startChamber = TestingObj.spinChamber(); int bulletChamber = TestingObj.spinChamber(); int ChamberPosition = TestingObj.Playing(numPlayers, startChamber, bulletChamber); if (ChamberPosition == -1) { Assert.AreEqual(obj.WinGame, obj.WinGame); Assert.AreEqual(obj.LoseGame, obj.LoseGame); } else { Assert.AreEqual("NextRound", "NextRound"); } }
void Awake() { player = GameObject.Find("Player").GetComponent <WinLose>() as WinLose; }
// Player move is based on the movement in real world. So we basically transform // the gps coordinate to a local coordiante and share with other players. void Update() { // Setup the bool values for each player. Determine if the player is seeker or runner if (NetworkServer.connections.Count > 0) { latitudeO = MapTools.getLatO(); longitudeO = MapTools.getLonO(); if (isLocalPlayer) { isSeeker = true; } else { isSeeker = false; } if (name != null) { SaveData.add(name); } if (SaveData.isDead(name)) { isDead = true; } } // If "I am dead" if (isDead) { if (isLocalPlayer) { WinLose.lose(); } this.gameObject.SetActive(false); return; } // If "I am a seeker", set my color to red if (isSeeker) { this.color = Color.red; ui.changeToSeek(); } else { this.color = Color.white; ui.changeToHide(); } player.GetComponent <SkinnedMeshRenderer>().materials[0].color = color; player.GetComponent <SkinnedMeshRenderer>().materials[1].color = color; if (!isLocalPlayer) { return; } if (!isSeeker && latitudeO != 0) { MapTools.setLatO(latitudeO); MapTools.setLonO(longitudeO); } // Syc the name and the location. Move the model CmdSetName(PlayerDataManager.s_Instance.playerName); CmdSetP(MapTools.getLat(), MapTools.getLon()); latitude = MapTools.getLat(); longitude = MapTools.getLon(); name = PlayerDataManager.s_Instance.playerName; transform.position = new Vector3(Camera.main.transform.position.x, 0, Camera.main.transform.position.z); transform.rotation = Camera.main.transform.rotation; }
//Get the needed components private void GetComponents() { global = GameObject.FindGameObjectWithTag("GlobalScripts"); wl = global.GetComponent <WinLose>(); }
public void WinLoseHandler(WinLose winLose) { this.winLose += winLose; }
void Start() { player = GameObject.Find("Player").GetComponent<WinLose>() as WinLose; body.AddForce(this.transform.forward * strength * modifier * Time.deltaTime); timeAlive = Time.time; }
// Use this for initialization void Start() { global = GameObject.FindGameObjectWithTag("GlobalScripts"); wl = global.GetComponent <WinLose>(); sc = global.GetComponent <SceneControl>(); }
void Awake() { player = GameObject.Find("Player").GetComponent<WinLose>() as WinLose; }
void Start() { player = GameObject.Find("Player").GetComponent <WinLose>() as WinLose; body.AddForce(this.transform.forward * strength * modifier * Time.deltaTime); timeAlive = Time.time; }