Game Development Reference
In-Depth Information
How it works...
Whenever the user taps on the screen, a delegate method of UIResponder is called.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent
*)event
{
}
In this method, the position of the touch is converted into local coordinates of SKScene .
Based on the location detected, it is compared to the spaceship location and up or down ac-
tion is applied on it.
Finally, as an outcome of this chapter, you have a small fundamental game with an environ-
ment of blue sky with white clouds moving with an infinite scroll and a spaceship flying up
and down in a linear motion.
This is what the game looks like now:
Search WWH ::




Custom Search