September 2018
Intermediate to advanced
434 pages
8h 47m
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