void Start() { rScoreInt = 0; bScoreInt = 0; bhealth = 3; rhealth = 3; redController = redShip.GetComponent <ShipController>(); blueController = blueShip.GetComponent <BlueController>(); redEnemyDead = false; blueEnemyDead = false; // redController.currentlyDestroyed = true; // blueController.currentlyDestroyed = true; redScore.fontSize = -5; blueScore.fontSize = -5; redHealthDisplay.fontSize = -5; blueHealthDisplay.fontSize = -5; welcomefreeze = true; territoryfreeze = norefreeze = noshootrefreeze = false; blueForward = blueTurn = redForward = redTurn = false; territoriespanel.SetActive(false); shootingpanel.SetActive(false); finishpanel.SetActive(false); }
// Initialising healths, scores and the timer void Start() { rScoreInt = 0; bScoreInt = 0; bhealth = 3; rhealth = 3; redScore.text = "Score: \n" + rScoreInt.ToString(); blueScore.text = "Score: \n" + bScoreInt.ToString(); redHealthDisplay.text = "HP: " + rhealth.ToString(); blueHealthDisplay.text = "HP: " + bhealth.ToString(); roundTimer = 60; roundTimerDisplay.text = "Time Remaining: " + roundTimer.ToString(); redController = redShip.GetComponent <ShipController>(); blueController = blueShip.GetComponent <BlueController>(); gameover = false; gameoverpanel.SetActive(false); }
void Update() { vx_turret.y += BlueController.AxisBlue_X(); // print(Convert.ToDecimal( BlueController.data.Replace("p", ""))); vy_turret.z += BlueController.AxisBlue_Y(); // print(yn); //print("roll"); // print(yn); //Axis x vx_turret.y = Mathf.Clamp(vx_turret.y, -90, 90); qx_turret = Quaternion.Euler(vx_turret); tx_turret.rotation = Quaternion.Lerp(tx_turret.rotation, qx_turret, 0.05f); //Axis Y vy_turret.z = Mathf.Clamp(vy_turret.z, -50, 20); vy_turret.y = vx_turret.y; qy_turret = Quaternion.Euler(vy_turret); ty_turret.rotation = Quaternion.Lerp(ty_turret.rotation, qy_turret, 0.05f); if (BlueController.BlueLeft()) { Shooting(); count++; } }
private void RefreshShownColor() { GreenController.SetBrightness(Color.G / 255f * Brightness); RedController.SetBrightness(Color.R / 255f * Brightness); BlueController.SetBrightness(Color.B / 255f * Brightness); }