Get Instant Help From 5000+ Experts For

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Steps to Develop a Game using Swift and UIKit

Stage 1

There may be many approaches to implement this game. Here is one possible pathway for the essential

development, which is highly recommended:

Stage 1.

1. Position the shooter object. Its initial position should be at the center of the left screen border, and it can be touched and dragged. The movement should be constrained into a square box area that is centered along the left boundary of the phone screen. The size of this square box should not be too big.

a. Read Lecture 4 and Lab 4 for how to add a draggable image with constrained movement area.

b. Start the project with screen-fit programming approach. Refer to Lecture 3 for the technique of screen-fit programming.

2. Make the shooter object more real. When the user releases the finger off the phone screen, the shooter should resume to be initial position. This can be coded within the touchesEnd() function.

a. Read Lecture 4 and Lab 4 for how to program the draggable image class.

3. Create the ball object. Delegate needs to be used for this feature. When the user releases the finger off the phone screen, a ball object should be created within the main ViewController and appear on the phone screen.

a. Read Lecture 5 for the definition of delegate.

4. Add dynamics to the ball. Once the balls are created, they will move with linear speed (for

the moment, just set up some random directions for the balls to travel). The balls will collide

with each other if there are multiple ones on the screen. The balls should also collide with the

top, bottom, and left boundaries of the phone screen.

a. Read Lecture 6 and Lab 6 for using UIKit Dynamics to create motion with linear speed

as well as collision with boundaries.

5. Shoot the ball with a specific angle. Set up a vector as global variables in the main ViewController, based on which the ball will move with linear speed at a certain direction. When user’s touch on the shooter object has moved, the vector should be updated on live basis (this feature needs to be implemented using delegate). When user’s touch on the shooter object has ended, a ball object should be created and linear speed motion.

a. Read Lecture 5 for the definition of delegate.

b. Read Lecture 6 for defining a vector for the direction of linear movement.

Stage 2.

6. Create the bird object. Only create one bird in a fixed location for now. When any ball object intersects with the bird object, the bird object should be removed, and one score should be gained.

c. Read Lab 3 for removing a subview.

7. Randomly create the birds. The emergence of the birds should be random, and all position along the right border of the phone screen. The birds should not overlap with each other.

a. Read Lab 5 for the use of timer.

b. Read Lab 3 for the intersection of image views.

c. Read Lab 2.2 for the use of arrays.

d. Read Lab 2.3 for generating random numbers.

8. Set a time-out for the game.

a. Read Lab 5 for the use of timer.

9. Implement a Game-Over screen. Enable replay.

a. Read Lab 3 for how to make a view show/hidden.

Stage 3.

10. Stretch abilities. If you are feeling keen, confident, and devoted, you may wish to stretch your abilities and add some additional features to make your app more publish-worthy (but you will need to commit yourself with a decent amount of research efforts). Here are some potential ideas that you may wish to consider.

• Create different levels of games. In each level, there is a random obstacle block placed somewhere in the screen, as shown in Figure 3. The ball will bounce off the blocks, and therefore need to bypass it in order to hit the birds. Watch the showcase video stage 3 for the effects