Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        cameraBody = GetComponent <Transform>();
        PlayerBall playerBall = GetComponent <PlayerBall>();

        camRigidBdy = GetComponent <Rigidbody>();
    }
Beispiel #2
0
    private void CheckShoot()
    {
        //checkeo la pulsacion
        if (Input.GetButtonDown("Shoot"))
        {
            // cojo la referencia de la instancia que he creado
            GameObject ball = Instantiate(prefabBall);

            // de la instanci a saco la referencia del script "PLAYERBALL"
            PlayerBall scriptPlayerball = ball.GetComponent <PlayerBall>();
            // si estoy mirando hacia la dereche lo pongo en la derecha  si no en la izquierda
            if (lookingRight)
            {
                //MUEVO LA PELOTA A LA PARTE DERECHA
                ball.transform.position = shootPointRight.position;
                // LE DIGO AL SCRIPT DE LA PELO QUE SE MUEVA A LA DERECHA
                scriptPlayerball.flyingRight = true;
            }
            else
            {
                ball.transform.position      = shootPointLeft.position;
                scriptPlayerball.flyingRight = false;
            }
        }
    }
Beispiel #3
0
 private void Start()
 {
     if (player == null)
     {
         player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBall>();
     }
 }
Beispiel #4
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Item")
     {
         PlayerBall player = other.GetComponent <PlayerBall>();
         itemCount++;
         audio.Play();
         other.gameObject.SetActive(false);
         manager.GetItem(itemCount);
     }
     else if (other.tag == "Point")
     {
         if (itemCount == manager.totalItemCount)
         {
             if (manager.stage == 1)
             {
                 SceneManager.LoadScene(0);
             }
             else
             {
                 SceneManager.LoadScene((manager.stage + 1));
             }
             //game Clear!
         }
         else
         {
             SceneManager.LoadScene(manager.stage);
             //Restart..
         }
     }
 }
Beispiel #5
0
 public void Change(uint id, PlayerBall newBall)
 {
     if (PlayerDictionary.ContainsKey(id))
     {
         PlayerDictionary[id] = newBall;
     }
 }
Beispiel #6
0
    // Use this for initialization
    void Start()
    {
        followCube = GetComponent <Transform>();
        PlayerBall playerBall = GetComponent <PlayerBall>();

        cubeBody = GetComponent <Rigidbody>();
        sound    = GetComponent <AudioSource>();
        cubeCol  = GetComponent <BoxCollider>();
        sound.Play();
        cubeBody.velocity = new Vector3(cubeBody.velocity.x, -30f, 34f);
        width             = Screen.width;
        height            = Screen.height;
        scaler            = width / 1366f;
        score             = 0;
        fallTimer         = 0;
        exitTimer         = 0;
        turnMultiplier    = 1;
        onFinishArea      = false;
        onExit            = false;
        if (MainMenu.materialStats[0].music == 1)
        {
            cubeCol.material = MainMenu.materials[1];
        }
        else if (MainMenu.materialStats[0].music == 2)
        {
            cubeCol.material = MainMenu.materials[2];
        }
        cameraMain = GameObject.Find("MainCamera");
        //smoothFollow = cameraMain.GetComponent("SmoothFollow") as MonoBehaviour;
        //smoothFollow.enabled = true;
    }
    public StrokeAngleIndicator(PlayerBall playerBall)
    {
        _playerBall = playerBall;
        var prefab = (GameObject)Resources.Load("StrokeAngleIndicator", typeof(GameObject));

        Debug.Assert(prefab != null);
        _object = GameObject.Instantiate(prefab);
    }
Beispiel #8
0
    public StrokeManager(PlayerBall playerBall, float strokeAngle = 0)
    {
        _strokeAngleIndicator = new StrokeAngleIndicator(playerBall);
        StrokeAngle           = strokeAngle;
        _strokeAngleIndicator.SetAngle(StrokeAngle);

        // this._strokeForceUI = new StrokeForceUI();
    }
Beispiel #9
0
        // Use this for initialization
        void Start()
        {
            Instantiate(ball, startingPos, Quaternion.identity);

            playerBall = FindObjectOfType <PlayerBall>();

            playerBall.ConstrainRB();
        }
Beispiel #10
0
        public override Vector2 getDirection()
        {
            Vector2 v = (PlayerBall.getInstance().getPosition() - ball.getPosition());

            Console.WriteLine(v);

            return(v / v.Length());
        }
Beispiel #11
0
 void OnTriggerEnter(Collider other)
 {
     if (other.name == "Player")
     {
         PlayerBall player = other.GetComponent <PlayerBall>();
         player.itemCount++;
         gameObject.SetActive(false);
     }
 }
Beispiel #12
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBall>();
    }
Beispiel #13
0
    void Start()
    {
        GameObject playerObj;

        if (playerObj = GameObject.Find("PlayerBall"))
        {
            player = playerObj.GetComponent <PlayerBall>();
        }
    }
Beispiel #14
0
 protected override void InitEvent()
 {
     balls        = new List <GameObject>();
     messageBoxes = new Dictionary <GameObject, GameObject>();
     reticules    = new Dictionary <GameObject, GameObject>();
     targets      = new Dictionary <GameObject, Transform>();
     offset       = new Vector3(0,
                                messageBoxPrefab.GetComponent <RectTransform>().rect.height,
                                0);
     playerBall = GameObject.Find("PlayerBall").GetComponent <PlayerBall>();
 }
Beispiel #15
0
    public override void OnTouchPlayer(PlayerBall player)
    {
        if (LevelManager.instance.isGameOver)
        {
            return;
        }

        player.AddScore(score);
        player.SetColor(currentColor);

        HandleDamage(1);
    }
Beispiel #16
0
    // Implement IUnityAdsListener interface methods:
    public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
    {
        playingSceneCanves  = FindObjectOfType <PlayingSceneCanves>();
        playingSceneManager = FindObjectOfType <PlayingSceneManager>();
        playerBall          = FindObjectOfType <PlayerBall>();
        startSceneCanves    = FindObjectOfType <StartSceneCanves>();
        openBallsManager    = FindObjectOfType <OpenBallsManager>();

        // Define conditional logic for each ad completion status:
        if (showResult == ShowResult.Finished)
        {
            // Reward the user for watching the ad to completion.
            if (!isBallAd)
            {
                print("Player Finished the ad");
                playerBall.RevivePlayer();
                playingSceneCanves.HideAdMenu();
            }
            else
            {
                startSceneCanves.ChoosedBall.IsAdNeeded = false;
                startSceneCanves.SetBallSprite(startSceneCanves.ChoosedBall);//open the choosed ball if he watced the ad succesfuly
                startSceneCanves.HideLockedPanel();
            }
        }
        else if (showResult == ShowResult.Skipped)
        {
            // Do not reward the user for skipping the ad.
            if (!isBallAd)
            {
                print("Player Skipped the ad");
                playingSceneManager.LoseTheGame();
                playingSceneCanves.HideAdMenu();
            }
            else
            {
                startSceneCanves.HideLockedPanel();
            }
        }
        else if (showResult == ShowResult.Failed)
        {
            if (!isBallAd)
            {
                Debug.LogWarning("The ad did not finish due to an error.");
                playingSceneManager.LoseTheGame();
                playingSceneCanves.HideAdMenu();
            }
            else
            {
                startSceneCanves.HideLockedPanel();
            }
        }
    }
Beispiel #17
0
        private static bool OnProcessBorn(NetServer server, int id, NetIncomingMessage msg)
        {
            var r = new Msg_AgarBorn();

            r.R(msg);

            uint   uid  = r.UserId;
            string name = r.Name;

            int  x      = RandomMaker.Next(GameWidth);
            int  y      = RandomMaker.Next(GameHeight);
            int  radius = PlayerBall.DefaultPlayerRadius;
            uint c      = CustomColors.RandomColor;

            // 添加Player到Manager
            PlayerBall player = new PlayerBall();

            player.X      = x;
            player.Y      = y;
            player.Radius = radius;
            player.Color  = c;
            player.Name   = name;
            PlayerBallMgr.Add(uid, player);

            MarkMgr.Update(uid, radius);

            // 更新链接对应的ID
            AgarConnMgr.Modify(msg.SenderConnection, uid);

            // 向自身发送出生位置等信息
            var selfMsg = new Msg_AgarSelf();

            selfMsg.Operat = Msg_AgarSelf.Born;
            selfMsg.X      = x;
            selfMsg.Y      = y;
            selfMsg.Radius = radius;
            selfMsg.Color  = c;
            SendMessage(server, selfMsg, msg.SenderConnection);

            // 向之前加入的玩家推送新用户出生信息
            var oMsg = new Msg_AgarPlayInfo();

            oMsg.Operat = Msg_AgarPlayInfo.Add;
            oMsg.UserId = uid;
            oMsg.Tag    = GameMessageHelper.ALL_TAG;
            oMsg.X      = x;
            oMsg.Y      = y;
            oMsg.Radius = radius;
            oMsg.Color  = c;
            oMsg.Name   = name;
            SendMessageExceptOne(server, oMsg, msg.SenderConnection);
            return(true);
        }
Beispiel #18
0
    protected void Start()
    {
        pb = GameObject.Find("PlayerBall").GetComponent <PlayerBall>();
        doneGoalCompleted = false;
        initCameraPos     = Camera.main.transform.position.z;
        ScoreCalculator.ScorePredictionUpdated += HandleScorePrediction;
        ScoreCalculator.PlayerScored           += HandlePlayerScored;

        Time.timeScale   = 0;
        gameStarted      = false;
        countdownStarted = false;

        InitGame();
    }
    private void SetupPlayerBalls(List <GridBall> initialBalls)
    {
        activePlayerBall = Instantiate(playerBallPrefab, activeBallPosition);
        var firstRowBalls  = initialBalls.FindAll(b => b.GridData.RowIndex == 0);
        var randomFirstBal = firstRowBalls[Random.Range(0, firstRowBalls.Count)];

        firstRowBalls.Remove(randomFirstBal);
        var startingBallSettings = GameplayManager.Instance.GameSettings.BallSettings.Find(s => s.Value == randomFirstBal.Score);

        activePlayerBall.SetInfo(startingBallSettings);

        SpawnStandByBall(firstRowBalls);
        isInAimMode = true;
    }
Beispiel #20
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         //DoThing
         PlayerBall playerBall = other.gameObject.GetComponent <PlayerBall>();
         //if we found the PlayerBall, run the function
         if (playerBall != null)
         {
             playerBall.IncreaseSpeed(speedIncreaseAmount);
         }
         //Disable this object
         gameObject.SetActive(false);
     }
 }
 private void SetNextBall()
 {
     standbyPlayerBall.transform.DOMove(activeBallPosition.position, newBallAppearTimer).
     OnStart(() =>
     {
         standbyPlayerBall.transform.DOScale(new Vector3(activeBallSize, activeBallSize, activeBallSize), newBallAppearTimer);
     }).
     OnComplete(() =>
     {
         activePlayerBall = standbyPlayerBall;
         activePlayerBall.transform.SetParent(activeBallPosition);
         SpawnStandByBall();
         isInAimMode = true;
     });
 }
Beispiel #22
0
        public static bool UpdatePlayer(uint id, ref PlayerBall ball)
        {
            bool PlayerDeadFlag = false;

            foreach (var obj in PlayerBallMgr.ToList())
            {
                if (obj.Key != id && CanEat(ball, obj.Value))
                {
                    PlayerDeadFlag = true;
                    ball.Radius   += obj.Value.Radius;
                    PlayerBallMgr.Dead(obj.Key);
                }
            }
            return(PlayerDeadFlag);
        }
Beispiel #23
0
        public static bool UpdateOtherPlayer(uint id, PlayerBall ball, out uint EatId)
        {
            bool PlayerDeadFlag = false;
            uint did            = 0;

            foreach (var obj in PlayerBallMgr.ToList())
            {
                if (obj.Key != id && CanEat(obj.Value, ball))
                {
                    PlayerDeadFlag = true;
                    did            = obj.Key;
                    PlayerBallMgr.Dead(id);
                    break;
                }
            }
            EatId = did;
            return(PlayerDeadFlag);
        }
    private void SpawnStandByBall(List <GridBall> possibleStandbyBalls = null)
    {
        standbyPlayerBall = Instantiate(playerBallPrefab, standbyBallPosition);
        standbyPlayerBall.transform.localScale = Vector3.zero;
        standbyPlayerBall.transform.DOScale(standbyBallSize, newBallAppearTimer);
        if (possibleStandbyBalls == null)
        {
            possibleStandbyBalls = GridController.Instance.GetPossibleBalls();
            if (possibleStandbyBalls.Count > 1 && possibleStandbyBalls.Find(b => b.Score == activePlayerBall.Score))
            {
                possibleStandbyBalls.Remove(possibleStandbyBalls.Find(b => b.Score == activePlayerBall.Score));
            }
        }
        var randomBallValue     = possibleStandbyBalls[Random.Range(0, possibleStandbyBalls.Count)].Score;
        var standbyBallSettings = GameplayManager.Instance.GameSettings.BallSettings.Find(s => s.Value == randomBallValue);

        standbyPlayerBall.SetInfo(standbyBallSettings);
    }
Beispiel #25
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            playerBall = new PlayerBall(new Vector2(ballRadius * 2, windowHeigth / 2), 0, Vector2.Zero, Vector2.Zero, ballRadius, BallType.PLAYER, Color.White);

            enemyBall = new Ball(new Vector2(windowWidth / 2, windowHeigth / 2), 0, Vector2.Zero, Vector2.Zero, ballRadius, BallType.ENEMY, Color.Yellow);

            targetBall = new Ball(new Vector2(2, 1), 0, Vector2.Zero, Vector2.Zero, ballRadius, BallType.TARGET, Color.Red);

            mouseArrow = new MouseArrow(new Vector2(ballRadius * 4, windowHeigth / 2), 0,
                                        Vector2.Zero, Vector2.Zero, Content.Load <Texture2D>("arrow"));

            windArrow = new WindArrow(new Vector2(1, 1.3f), 0,
                                      Vector2.Zero, Vector2.Zero, Content.Load <Texture2D>("arrow"));

            // TODO: use this.Content to load your game content here
        }
Beispiel #26
0
    public override void OnTouchPlayer(PlayerBall player)
    {
        player.SetColor(currentColor);
        if (touchSfx != null)
        {
            SoundManager.instance.PlaySound2D(touchSfx);
        }

        /*float xVel = Mathf.Abs(player.rbd2.velocity.x);
         * float yVel = Mathf.Abs(player.rbd2.velocity.y);
         *
         * if (xVel > yVel)
         * {
         *  player.rbd2.velocity = new Vector2(player.rbd2.velocity.x, -1 * player.rbd2.velocity.y) * 3;
         * } else if (yVel > xVel)
         * {
         *  player.rbd2.velocity = new Vector2(-1 * player.rbd2.velocity.x, player.rbd2.velocity.y) * 3;
         * }*/
    }
Beispiel #27
0
	// Use this for initialization
	void Start () {
		if(controlCenter == null){
			controlCenter = GameObject.Find ("Control Center");
		}
		if(player == null){
			player = GameObject.Find ("Player");
		}
		playerScript = player.GetComponent<PlayerBall>();
		
		gui = this.GetComponent<GUITexture>();
		currentMode = Control.currentControl;
		
		scaledHeight = Screen.height/3;
		xPosition = -scaledHeight;
		yPosition = 0;
		gui.pixelInset = new Rect(xPosition, yPosition, scaledHeight, scaledHeight);
		
		gui.texture = Textures[currentMode];
	}
    private void OnTriggerEnter(Collider other)
    {
        if (!other.CompareTag("PlayerBall"))
        {
            return;
        }

        PlayerBall pb = other.GetComponent <PlayerBall>();

        pb.HitGoal(transform.position);

        int level = 0;

        for (int i = 0; i < SceneManager.sceneCount; i++)
        {
            string   name         = SceneManager.GetSceneAt(i).name;
            string[] nameAndLevel = name.Split('-');

            if (nameAndLevel.Length != 2 || !nameAndLevel[0].Equals("Level"))
            {
                continue;
            }

            if (!int.TryParse(nameAndLevel[1], out level))
            {
                continue;
            }
            else
            {
                if (level <= 0)
                {
                    continue;
                }

                GameManager.Instance.CompletedLevel(level);

                PlayFireworks();
            }
        }
    }
Beispiel #29
0
        public static bool UpdateFood(uint id, ref PlayerBall ball)
        {
            bool FoodRemoveFlag = false;

            foreach (var obj in FixedBallMgr.ToList())
            {
                if (CanEat(ball, obj.Value))
                {
                    FoodRemoveFlag = true;
                    if (ball.Radius < PlayerBall.DefaultPlayerNoFoodRadius)
                    {
                        ball.Radius++;
                    }
                    FixedBallMgr.Remove(obj.Key);
                }
            }
            if (FoodRemoveFlag)
            {
                FixedBallMgr.Update();
            }
            return(FoodRemoveFlag);
        }
Beispiel #30
0
    // Use this for initialization
    void Start()
    {
        if (controlCenter == null)
        {
            controlCenter = GameObject.Find("Control Center");
        }
        if (player == null)
        {
            player = GameObject.Find("Player");
        }
        playerScript = player.GetComponent <PlayerBall>();

        gui         = this.GetComponent <GUITexture>();
        currentMode = Control.currentControl;

        scaledHeight   = Screen.height / 3;
        xPosition      = -scaledHeight;
        yPosition      = 0;
        gui.pixelInset = new Rect(xPosition, yPosition, scaledHeight, scaledHeight);

        gui.texture = Textures[currentMode];
    }
    private void Update()
    {
        if (isGameOver)
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                gameOverText.SetActive(false);
                Time.timeScale = 1;
                PlayerBall playerBall   = FindObjectOfType <PlayerBall>();
                Rigidbody  playerBallRB = playerBall.GetComponent <Rigidbody>();
                playerScore = 0;
                SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex);
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape) && !isPaused)
        {
            PauseGame();
        }
        else if (Input.GetKeyDown(KeyCode.Escape) && isPaused)
        {
            ResumeGame();
        }
    }
Beispiel #32
0
	void Start()
	{
		if(player == null){
			player = GameObject.Find("Player");
		}
		if(ControlCenter == null)
		{
			ControlCenter = GameObject.Find ("Control Center");
		}
		if(jumpButton == null)
		{ // Get the separate jump button
			jumpButton = GameObject.Find ("JoyJump");
		}
		
		playerScript = player.GetComponent<PlayerBall>();
		
		// Cache this component at startup instead of looking up every frame	
		gui = GetComponent< GUITexture>();
		
		if(!touchPad) // If this is a joystick...
		{
			// Get joystickSize setting and multiplier
			sizeMultiplier = (Control.joystickSize);
			sizeMultiplier = sizeMultiplier/100;
			
			if(sizeMultiplier != 0)
			{ // If sizeMultipler is actually set, use it
				scaledHeight = Screen.height/4 * sizeMultiplier;
			}
			else // If joystickSize is not set, use default size
			{
				scaledHeight = Screen.height/4;
			}	
			
			xPos = scaledHeight;
			yPos = scaledHeight/2;
			gui.pixelInset = new Rect(xPos, yPos, scaledHeight, scaledHeight);
		
		}
		else{
		/* Old	
			scaledWidth = Screen.width/2;
			scaledHeight = Screen.height*1/3;
			xPos = -scaledWidth;
			yPos = 0;
		*/	
		
			scaledWidth = Screen.width/2;
			scaledHeight = Screen.height*7/8;
			xPos = -scaledWidth;
			yPos = 0;
			
			gui.pixelInset = new Rect(xPos, yPos, scaledWidth, scaledHeight);
		}
		
		// Store the default rect for the gui, so we can snap back to it
		defaultRect = gui.pixelInset;	
		
		defaultRect.x += transform.position.x * Screen.width;// + gui.pixelInset.x; // -  Screen.width * 0.5;
		defaultRect.y += transform.position.y * Screen.height;// - Screen.height * 0.5;
		
		transform.position = Vector2.zero;
		
		if ( touchPad )
		{
			// If a texture has been assigned, then use the rect ferom the gui as our touchZone
			if ( gui.texture )
				//	touchZone = new Rect(0,0,scaledWidth, scaledHeight);
				touchZone = defaultRect;
		}
		else
		{				
			// This is an offset for touch input to match with the top left
			// corner of the GUI
			guiTouchOffset.x = defaultRect.width * 0.5f;
			guiTouchOffset.y = defaultRect.height * 0.5f;
			
			// Cache the center of the GUI, since it doesn't change
			guiCenter.x = defaultRect.x + guiTouchOffset.x;
			guiCenter.y = defaultRect.y + guiTouchOffset.y;
			
			// Let's build the GUI boundary, so we can clamp joystick movement
			guiBoundary.min.x = defaultRect.x - guiTouchOffset.x;
			guiBoundary.max.x = defaultRect.x + guiTouchOffset.x;
			guiBoundary.min.y = defaultRect.y - guiTouchOffset.y;
			guiBoundary.max.y = defaultRect.y + guiTouchOffset.y;
			
			/*
			1) Get guiCenter
			2) Get guiDiameter (guiBoudnary.max.x - min.x)
			3) Set background texture positon as guiCenter
			4) Set size of background texture using guiDiameter
			5) Set pixeloffset using that
			
			Above won't work, use some relative math to NOT make it dependent
			on this script. Need following data (how calculated):
			1) Center of joystick
			2) The min/max of the joystick
			3) Calculating the surrounding box of the joystick
			*/
	//		guiBoundary.min = new Vector2(defaultRect.x - guiTouchOffset.x,
	//		                              defaultRect.x + guiTouchOffset.x);

		}
	}
Beispiel #33
0
 public PlayerImpact(BaseBall p)
     : base(p)
 {
     player = (PlayerBall)p;
 }
Beispiel #34
0
	float radius;						// The radius of the entire indicator
	
	// Use this for initialization
	void Start () {
		if(player == null){
			player = GameObject.Find ("Player");
		}
		playerScript = player.GetComponent<PlayerBall>();
		
		// Get the NormalPercent tilt multiplier
		GetNormalPercent();
		
		// If this is the background for the tilt indicator...
		if(thisControl == ControlType.Indicator_BG)
		{
			// get the GUITexture
			gui = this.GetComponent<GUITexture>();
			
			// Set dimensions for the texture
			scaledHeight = Screen.height*3/10;
			xPos = 0;
			yPos = 0;
			
			// Apply dimensions
			gui.pixelInset = new Rect(xPos, yPos, scaledHeight, scaledHeight);
		}
		else if(thisControl == ControlType.Indicator_Dot)
		{
			// get the GUITexture
			gui = this.GetComponent<GUITexture>();
			
			// Set dimensions for the texture
			scaledHeight = (Screen.height*3/10)/4;
			xPos = (Screen.height*3/10)/2 - scaledHeight/2;
			yPos = (Screen.height*3/10)/2 - scaledHeight/2;
			
			// Apply dimensions
			gui.pixelInset = new Rect(xPos, yPos, scaledHeight, scaledHeight);
			// Cache the default position and size
			defaultRect = gui.pixelInset;
			offsetRect = defaultRect;
			radius = offsetRect.x;
		}
		// This object controls jumping...
		else if(thisControl == ControlType.Jump){
			
			scaledWidth = Screen.width;
			scaledHeight = Screen.height*7/8;
			xPos = 0;
			yPos = 0;
			
			// If using a texture...
			if(jumpTexture)
			{
				// get the GUITexture
				gui = this.GetComponent<GUITexture>();
				
				gui.pixelInset = new Rect(xPos, yPos, scaledWidth, scaledHeight);
				defaultRect = gui.pixelInset;
				touchZone = defaultRect;
				
				Color color = gui.color;
				color.a = 0.2f;
				gui.color = color;
			}
			else if (!jumpTexture) // If not displaying jumpTexture...
			{
				this.GetComponent<GUITexture>().enabled = false;
				defaultRect = new Rect(xPos, yPos, scaledWidth, scaledHeight);
				touchZone = defaultRect;
			}
		}
	}