void Awake() { bStartAni = false; show_step = 0; timer = 0; gameCon = GameObject.Find ("GameCon").GetComponent<GameCon> (); }
private void Start_Click(object sender, RoutedEventArgs e) { if (PlayerNameInput.Text.Length >= 1) { if (StandartCardCheck.IsChecked == true) { GameCon game = new GameCon(CardTypes.Value, PlayerNameInput.Text); game.StartGame(); AddCardsToCanvas(game.GetCards()); game.PlayerTurnEvent += Game_PlayerTurnEvent; GameScreen.Visibility = Visibility.Visible; Menu.Visibility = Visibility.Hidden; } else if (ImageCardCheck.IsChecked == true) { GameCon game = new GameCon(CardTypes.Image, PlayerNameInput.Text); game.StartGame(); AddCardsToCanvas(game.GetCards()); Menu.Visibility = Visibility.Hidden; GameScreen.Visibility = Visibility.Visible; } else { ErrorMessage("No card checked"); } } else { ErrorMessage("No player name"); Error.Visibility = Visibility.Visible; } }
// Use this for initialization void Start () { gameCon = GameObject.Find("GameCon").GetComponent<GameCon>(); uiSprite = this.GetComponent<UISprite> (); timer = 0; bStartFade = false; }
void Start() { Rigidbody2D Robot = GetComponent <Rigidbody2D>(); life = 75; if (GameCon.up2Y()) { life = +25; } slider.fillRect.GetComponent <Image>().color = color; maxValue = life / 100; slider.maxValue = maxValue; slider.minValue = 0; UpdateUI(); px = Random.Range(-15, 90); py = Random.Range(-60, 60); hod = 0; firet = 0; zam = 0; n = 1; GameObject[] gameObjects = GameObject.FindGameObjectsWithTag("Flag"); GameObject a = gameObjects[Random.Range(0, gameObjects.Length - 1)]; px = a.transform.position.x; py = a.transform.position.y; }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); screamSource = this.GetComponents<AudioSource>(); sacrifices [0] = sacrifice0; sacrifices [1] = sacrifice1; sacrifices [2] = sacrifice2; }
// Use this for initialization void Awake () { uis = GetComponent<UISprite> (); time = 0; uis.alpha = 1f; gameCon = GameObject.Find ("GameCon").GetComponent<GameCon>(); bShowFailText = false; }
// Use this for initialization void Start () { gameCon = GameObject.Find("GameCon").GetComponent<GameCon>(); // uiSlider = this.GetComponent<UISlider> (); tempValue2 = 0; }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); if ((gameCon.ctrl1Found && gameCon.isOnePlayer) || (gameCon.ctrl1Found && gameCon.ctrl2Found && !gameCon.isOnePlayer)) { canUseController = true; } }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); screamSource = this.GetComponents <AudioSource>(); sacrifices [0] = sacrifice0; sacrifices [1] = sacrifice1; sacrifices [2] = sacrifice2; }
// Use this for initialization void Awake () { bTimerStart = false; timer = 0; gameCon = GameObject.Find ("GameCon").GetComponent<GameCon> (); pd = PlayerData.Instance; efm = EffectSoundManagerScript.Instance; }
// Use this for initialization void Awake () { gameCon = GameObject.Find ("GameCon").GetComponent<GameCon> (); spr_Icon = this.transform.FindChild ("Layer2").GetComponent<UISprite> (); spr_Arrow = this.transform.FindChild ("Arrow").GetComponent<UISprite> (); lable_Count = this.transform.FindChild ("Count").GetComponent<UILabel> (); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } Time.timeScale = 0; }
private void Start() { GameObject gameConObj = GameObject.FindWithTag("GameController"); if (gameConObj != null) { gamecon = gameConObj.GetComponent <GameCon>(); } if (gamecon == null) { Debug.Log("Cannot find game con script help"); } }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); GameJolt.UI.Manager.Instance.ShowSignIn((bool success) => { if (success) { Debug.Log("The user signed in!"); gameCon.hasLogedIn = true; } else { Debug.Log("The user failed to signed in or closed the window :("); } }); }
// Use this for initialization void Start () { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); GameJolt.UI.Manager.Instance.ShowSignIn((bool success) => { if (success) { Debug.Log("The user signed in!"); gameCon.hasLogedIn = true; } else { Debug.Log("The user failed to signed in or closed the window :("); } }); }
// Start is called before the first frame update void Start() { if (instance == null) //singleton { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(this); UICon.startGame += StartGame; UICon.backButton += BackButtonPress; UICon.optionsButton += OptionsButtonPress; UICon.quitButton += QuitButtonPress; UICon.resetButton += ResetButtonPress; UICon.menuButton += MenuButtonPress; }
// Use this for initialization void Awake () { bHurryUpText = true; gameCon = GameObject.Find("GameCon").GetComponent<GameCon>(); pd = PlayerData.Instance; //timer = 0; bStartTimer = false; go_Base = GameObject.Find("waterTimeBase"); uil_time = GameObject.Find("text_WaterTimeSlider").GetComponent<UILabel>(); if (uil_time == null) { Debug.Log("this is null"); } //uiSlider = this.GetComponent<UISlider> (); }
static void Main() { GameController GameCon; var hcmm = new HumanConsoleMakeMove(); var aimm = new AIMakeMove(); var play = true; while (play) { Console.Title = "Tic-Tac-Toe"; Console.Clear(); Console.WriteLine("Please enter the number of players (0-2): "); var numberOfHumanPlayers = GetCorrectNumberOfPlayers(); if (numberOfHumanPlayers == 0) { GameCon = new GameController( new WinCondition(), new AIPlayer(aimm), new AIPlayer(aimm), new ConsoleIO()); } else if (numberOfHumanPlayers == 1) { GameCon = new GameController( new WinCondition(), new HumanPlayer(hcmm), new AIPlayer(aimm), new ConsoleIO()); } else { GameCon = new GameController( new WinCondition(), new HumanPlayer(hcmm), new HumanPlayer(hcmm), new ConsoleIO()); } play = GameCon.Run(); } }
// Update is called once per frame void Update() { if (life <= 0) { GameCon.FactM(); Instantiate(F, transform.position, Quaternion.identity); Destroy(gameObject); } if ((zak1 <= Time.time) && (zakch1 == 1)) { zakch1 = 0; if (GameCon.strar() == 2) { Instantiate(robot, transform.position, Quaternion.identity); Instantiate(robotTSm, transform.position, Quaternion.identity); Instantiate(robotTSm, transform.position, Quaternion.identity); } if (GameCon.strar() == 1) { Instantiate(robotR, transform.position, Quaternion.identity); } ZZZ.SetActive(false); } if (((Time.time - time2) - timel >= 30) && (GameCon.ress() >= 10) && GameCon.buils() > 4) { GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); GameCon.ot(); timel = Time.time; zakch1 = 1; zak1 = Time.time + 29; ZZZ.SetActive(true); } }
// Start is called before the first frame update void Start() { Rigidbody2D Robot = GetComponent <Rigidbody2D>(); life = 50; GameObject[] goArray; goArray = GameObject.FindGameObjectsWithTag("ResR"); int rand = Random.Range(0, goArray.Length); px = goArray[rand].transform.position.x; py = goArray[rand].transform.position.y; hod = 0; zam = 0; Base = new Vector3(-8, 93, 0); tur = new Vector3(-10, 30, 0); Fac = new Vector3(15, 61, 0); Fac2 = new Vector3(-37, 61, 0); GameCon.BsRplus(); Base = GameObject.FindGameObjectWithTag("PlBR").transform.position; Fac = GameObject.FindGameObjectWithTag("PlF").transform.position; Fac2 = GameObject.FindGameObjectWithTag("PlF2").transform.position; tur = GameObject.FindGameObjectWithTag("PlT").transform.position; FacT3 = GameObject.FindGameObjectWithTag("PlF3").transform.position; }
private void OnTriggerEnter(Collider other) { foreach (Player player in playersAtEnd) { if (player != other.gameObject.GetComponent <Player>()) { playersAtEnd.Add(other.gameObject.GetComponent <Player>()); break; } } if (other.gameObject.CompareTag("Player")) { if (playersAtEnd.Count == 0) { playersAtEnd.Add(other.gameObject.GetComponent <Player>()); } } if (playersAtEnd.Count == 2) { GameCon GC = FindObjectOfType <GameCon>(); GC.NextLevel(); } }
void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); rotation.Set (0, 1, 1, 0); }
// Use this for initialization void Start () { gameCon = GameObject.Find ("GameCon").GetComponent<GameCon>(); bMove = false; }
// Use this for initialization void Awake () { gameCon = GameObject.Find ("GameCon").GetComponent<GameCon> (); pd = PlayerData.Instance; }
private void Start() { GC = FindObjectOfType <GameCon>(); }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); rotation.Set(0, 0, 0, 0); splashSource = this.GetComponent <AudioSource>(); }
// Use this for initialization void Awake () { InventoryItemButtonObj = GameObject.Find("InventoryButton"); InventoryItemButtonObj.SetActive(false); ConveyorItemButtonObj = GameObject.Find("conveyorButton"); Pan_inventoryScrollView = GameObject.Find ("Panel_inventoryScrollView"); go_FillRect_Screen = GameObject.Find("FillRect_Screen"); go_FillRect_Screen.SetActive(false); float resolWidth = Screen.width; // Debug.Log("resolWidth: "+resolWidth); float resolHeight = Screen.height; // Debug.Log("resolHeight: "+resolHeight); float ratio1 = resolWidth/resolHeight; // Debug.Log("ratio1: "+ratio1); float gameWidth = 800 * ratio1; // Debug.Log("gameWidth: "+gameWidth); float ratio = gameWidth/1280; float tmpWidth = (gameWidth - 372*ratio); Vector4 range = new Vector4(0, 0, tmpWidth, 160); //Pan_inventoryScrollView.GetComponent<UIPanel>().clipping = UIDrawCall.Clipping.SoftClip; Pan_inventoryScrollView.GetComponent<UIPanel>().baseClipRegion = range; //Pan_inventoryScrollView.GetComponent<UIPanel>().drawCallClipRange = new Vector4(0, 0, Screen.width - 360, 160); gd = GlobalData.Instance; // GameObject.Find("Prefab_Pipe").GetComponent<PipeScript>().setID(170); // GameObject.Find("Prefab_Pipe1").GetComponent<PipeScript>().setID(171); // GameObject.Find("Prefab_Pipe2").GetComponent<PipeScript>().setID(172); // GameObject.Find("Prefab_Pipe3").GetComponent<PipeScript>().setID(173); // GameObject.Find("Prefab_Pipe4").GetComponent<PipeScript>().setID(64); // GameObject.Find("Prefab_Pipe5").GetComponent<PipeScript>().setID(65); // Instance = this; efm = EffectSoundManagerScript.Instance; pd = PlayerData.Instance; gd.setTileNum(0, true); go_Popup_Help = GameObject.Find("Popup_Help"); helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>(); ts = TextScript.Instance; uiSlider_Loading = GameObject.Find ("loading_Slider").GetComponent<UISlider> (); uiSlider_Loading.value = 0; bJustOneTimeCoroutine = false; go_fade = GameObject.Find("Anchor_Center_Fade"); bLoading = true; loading_state = 0; }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); if ((gameCon.ctrl1Found && isOnePlayer) || (gameCon.ctrl1Found && gameCon.ctrl2Found && !isOnePlayer)) canUseController = true; }
void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); }
// Use this for initialization void Start() { game = Camera.main.GetComponent <GameCon>(); isP1 = this.gameObject.tag == "P1 Button" ? true : false; gameObject.GetComponent <Image>().material = game.colors[int.Parse(this.gameObject.name)]; }
// Use this for initialization void Start() { game = Camera.main.GetComponent <GameCon>(); }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); rotation.Set (0, 0, 0, 0); splashSource = this.GetComponent<AudioSource>(); }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); bounceSource = this.GetComponent <AudioSource>(); }
// Update is called once per frame void Update() { Rigidbody2D Robot = GetComponent <Rigidbody2D>(); if (life <= 0) { GameCon.BsRminus(); Instantiate(F, transform.position, Quaternion.Slerp(transform.rotation, transform.rotation, 1)); Destroy(gameObject); } float hod1; hod1 = 0; float angle; GameObject[] goArray1; goArray1 = GameObject.FindGameObjectsWithTag("Allies"); for (int i = 0; i < goArray1.Length; i++) { if ((goArray1[i].transform.position - transform.position).sqrMagnitude <= 10) { GameObject cur; hod1 = hod1 + 1; if (hod1 == 1) { angle = Mathf.Atan2(transform.position.y - goArray1[i].transform.position.y, transform.position.x - goArray1[i].transform.position.x) * Mathf.Rad2Deg; var targetRotationF = Quaternion.Euler(new Vector3(0f, 0f, angle)); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotationF, 1); cur = Instantiate(Laser, transform.position, Quaternion.Slerp(transform.rotation, targetRotationF, 1)); cur.GetComponent <Rigidbody2D>().velocity = (new Vector3(goArray1[i].transform.position.x, goArray1[i].transform.position.y, 0) - cur.transform.position).normalized * 100; ZZZ.SetActive(true); Robot.velocity = new Vector3(0, 0, 0); } } } if ((transform.position - GameObject.FindGameObjectWithTag("PlF").transform.position).sqrMagnitude <= 60 && GameCon.Factt() == 1) { hod = 0; } if ((transform.position - GameObject.FindGameObjectWithTag("PlF2").transform.position).sqrMagnitude <= 60 && GameCon.Factt() == 2) { hod = 0; } if (hod1 == 0) { if (zam < Time.time) { angle = Mathf.Atan2(transform.position.y - py, transform.position.x - px) * Mathf.Rad2Deg; var targetRotationS = Quaternion.Euler(new Vector3(0f, 0f, (angle - 90))); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotationS, 1); Robot.velocity = (new Vector3(px, py, 0) - transform.position).normalized * 15; if (GameCon.tur() <= 0) { px = tur.x; py = tur.y; hod = 3; } if ((GameCon.Factt() == 0) && (GameCon.strar() <= 2) && (GameCon.ress() >= 10) & GameCon.buils() > 3) { px = Fac.x; py = Fac.y; hod = 4; } if ((GameCon.Factt() == 1) && (GameCon.strar() <= 2) && (GameCon.ress() >= 10) && GameCon.buils() > 3) { px = Fac2.x; py = Fac2.y; hod = 4; } if ((GameCon.Factt() == 2) && (hod == 4)) { hod = 0; } if ((GameCon.Factt() == 3) && (hod == 5)) { hod = 0; } if ((GameCon.tur() > 0) && (hod == 3)) { hod = 0; } if ((GameCon.ress() >= 50)) { px = FacT3.x; py = FacT3.y; hod = 5; } if ((transform.position - new Vector3(px, py, 0)).sqrMagnitude <= 25) { if (hod == 0) { GameObject[] goArray; goArray = GameObject.FindGameObjectsWithTag("ResR"); int rand = Random.Range(0, goArray.Length); px = goArray[rand].transform.position.x; py = goArray[rand].transform.position.y; GameCon.pr(); } if (hod == 1) { px = Base.x; py = Base.y; } if (hod == 3) { GameCon.turA(); Instantiate(turret, transform.position, Quaternion.identity); hod = 0; } if (hod == 4) { GameCon.FactP(); Instantiate(Factory, transform.position, Quaternion.identity); hod = 0; } if (hod == 5) { GameCon.FactP(); Instantiate(FactoryT3, transform.position, Quaternion.identity); hod = 0; } if ((GameCon.Factt() == 2) && (hod == 4)) { hod = 0; } if ((GameCon.tur() > 0) && (hod == 3)) { hod = 0; } } } if ((transform.position - Base).sqrMagnitude <= 25) { hod = 0; } if (zam > Time.time) { ZZZ.SetActive(true); Robot.velocity = (new Vector3(px, py, 0) - transform.position).normalized * 0; Robot.angularVelocity = 0; } else { if (hod == 1) { ColR.SetActive(true); } else { ColR.SetActive(false); } ZZZ.SetActive(false); } } }
// Use this for initialization void Awake () { gameCon = GameObject.Find ("GameCon").GetComponent<GameCon> (); bStartAni = false; }
void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); rotation.Set(0, 1, 1, 0); }
void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameCon>(); }
public GameCon getInstance() { if(Instance == null) { Instance = this; } return Instance; }
// Use this for initialization void Start() { gameCon = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameCon>(); bounceSource = this.GetComponent<AudioSource>(); }