



- Set the input sources for x&y from iPhone’s Accelerometer
- Create a Vector2 from the 2 x, y inputs
- Limit the vector(direction) into 1 by using “Vector2.sqrMagnitude”
- Think about the Lenth of Vector
- Relate this with the Pythagorean theorem


- Subtract the initial value of Y input from the whole Y input to prevent the player ship from going down when grabbing the phone downwards



- Create “UI Button”
- Add “Shoot Button” image to “Source Image” of “UI Button”
- Set the anchor to “Right-Bottom”

- Create a Function, “Shoot()” to make the button work
- move the code for shooting in “Update()” to “Shoot()”

- Set the action when the button is clicked
- Add “Player” to “On Click()” and Set “Shoot()” function


- Get the reference for ShootButton
- When Case “GamePlay”
- Set “shootButton” active
- When Case “GameOver”
- Set “shootButton” disactive

