February 2017
Beginner to intermediate
258 pages
5h 31m
English
Before we test out our new flying code, we need to make one adjustment. The default gravity setting of 9.8 feels too real. Pierre lives in a cartoon world; real-world gravity is a bit of a drag. We can adjust gravity in the GameScene class; add this line at the bottom of the didMove function:
// Set gravity self.physicsWorld.gravity = CGVector(dx: 0, dy: -5)
Read now
Unlock full access