Home

Awesome

GravityPlayground

Created for Swift Playgrounds 3.3 for iPad, in Xcode 11.4.1 on Mac. On iPad, most of the code is hidden.

Apple's SpriteKit has a physics engine that includes a gravity simulation. This Swift playground attempts to leverage it to teach users a bit about gravity from a physics perspective. It challenges the user to put satellites in orbit around planets to create their own planetary orbit system.

Credits

I started working on the playground with Xcode's Game template. All work done in the playground is my own. The spark.png image was obtained from Xcode's default SpriteKit particle textures. The earth.png and moon.png images are used for Planets and Satellites respectively, and I created them by editing NASA's public domain images of the Earth and the Moon.