private void Awake() { p1 = new Jai <MyMove>(gameState, new System.Random(seed.GetHashCode()), data, 0); p2 = new Jai <MyMove>(gameState, new System.Random(seed.GetHashCode()), data, 1); p1.cycleAmount = p1CycleAmount; p2.cycleAmount = p2CycleAmount; SwitchAI(); }
// Use this for initialization void Start() { startingJoystickSpot = transform.position; joystickAppearanceThreshhold = .8f; joystickMaxThumbDist = 1.3f; distToThrow = .1f; joystickFinger = -1; spearFinger = -2; moveForce = 10f; jaiScript = GameObject.Find ("Jai").GetComponent<Jai> (); controlStickSprite = GameObject.Find ("ControlStick").GetComponent<SpriteRenderer>(); jaiTransform = jaiScript.transform; balloonBasketBody = GameObject.Find ("BalloonBasket").GetComponent<Rigidbody2D>(); //correctionPixels = new Vector2 (Screen.width/2,-Screen.height/2); correctionPixels = new Vector2 (560,-960); //half of the screen width is 560 and yeah the heights weird [1280-640] //correctionPixelFactor = 5 / Screen.height; correctionPixelFactor = 5f / 320f; //5 game units divided by 320 pixels maxBalloonSpeed = balloonBasketBody.GetComponent<BalloonBasket>().maxBalloonSpeed; }
// Use this for initialization void Start() { startingJoystickSpot = transform.position; joystickAppearanceThreshhold = .8f; joystickMaxThumbDist = 1.3f; distToThrow = .1f; joystickFinger = -1; spearFinger = -2; moveForce = 10f; jaiScript = GameObject.Find("Jai").GetComponent <Jai> (); controlStickSprite = GameObject.Find("ControlStick").GetComponent <SpriteRenderer>(); jaiTransform = jaiScript.transform; balloonBasketBody = GameObject.Find("BalloonBasket").GetComponent <Rigidbody2D>(); //correctionPixels = new Vector2 (Screen.width/2,-Screen.height/2); correctionPixels = new Vector2(560, -960); //half of the screen width is 560 and yeah the heights weird [1280-640] //correctionPixelFactor = 5 / Screen.height; correctionPixelFactor = 5f / 320f; //5 game units divided by 320 pixels maxBalloonSpeed = balloonBasketBody.GetComponent <BalloonBasket>().maxBalloonSpeed; }
// Use this for initialization void Awake() { bounceForce = 20f; time2Destroy = 3f; time2Reappear = .9f; flying = false; throwing = false; spearString = "Prefabs/Gear/Spear"; spearTipParentTransform = transform.GetChild(0); spearTipTransform = transform.GetChild(0).GetChild(0); spearTipCollider = spearTipTransform.GetComponent <CircleCollider2D> (); pixelRotationScript = GetComponent <PixelRotation> (); pixelRotationScript.Angle = 0; joyfulstickScript = GameObject.Find("StickHole").GetComponent <Joyfulstick> (); jaiScript = GameObject.Find("Jai").GetComponent <Jai> (); jaiTransform = jaiScript.transform; jaiScript.spearScript = GetComponent <Spear>(); joyfulstickScript.spearScript = GetComponent <Spear>(); stockPosition = transform.position - jaiTransform.position; throwAdjustmentVector = new Vector3[] { new Vector3(0f, .26f, 0f), new Vector3(0f, .31f, 0f) }; }
// Use this for initialization void Awake() { bounceForce = 20f; time2Destroy = 3f; time2Reappear = .9f; flying = false; throwing = false; spearString = "Prefabs/Gear/Spear"; spearTipParentTransform = transform.GetChild (0); spearTipTransform = transform.GetChild (0).GetChild(0); spearTipCollider = spearTipTransform.GetComponent<CircleCollider2D> (); pixelRotationScript = GetComponent<PixelRotation> (); pixelRotationScript.Angle = 0; joyfulstickScript = GameObject.Find ("StickHole").GetComponent<Joyfulstick> (); jaiScript = GameObject.Find ("Jai").GetComponent<Jai> (); jaiTransform = jaiScript.transform; jaiScript.spearScript = GetComponent<Spear>(); joyfulstickScript.spearScript = GetComponent<Spear>(); stockPosition = transform.position - jaiTransform.position; throwAdjustmentVector = new Vector3[]{ new Vector3 (0f, .26f,0f), new Vector3 (0f, .31f,0f) }; }