I want to create 2d game. The game is similar to the Scale Puzzle. I've already created nearly all the functionality. Only the last remains.
This is example.
And that's how I draw shapes.
I click inside a white square, and after 1 seconds a square is drawn regardless of the position of the ball. (x,y). Square is created programmatically, and it is added to the parent element "SquaresList" with name New Game Object.
How can i do, so that the violet field becomes larger, and in the middle of the screen. I made it so that for every 3 clicks, "SquaresList" increases Scale by 0.25f, and get negative position of the ball. Example:
SquareList.transform.position = new Vector2(-ball.pos.x, -ball.pos.y)
This does not work correctly.
What options can be? (intersections, find the max/min point, math formulas) ?